.S. Or what could be a more effective way than:
<CODE]
void ReIndex(){
for(int i=0;i<buts.GetCount();i++){
buts[i].SetLabel(AsString(i));
buts[i].WhenAction=callback1(this,Suicide,i);
}
</CODE
every time after removing?
Or maybe to mark them as dead and then to filter actions everywhere else?
Are there any better ways?
Well, I believe this is not very callback-specific... it is simply the problem of unique identification of item in the array...
Solution depends on what you exactly want to achieve. What you propose is not that bad solution - if you NEED index, I see (at the moment) no other algorithmic way.
Alternative solution would have to introduce another form of unique id per button - e.g. you could post pointer to button instead of index, or you could use UUID and Index....