OP* Lukas maybe this is a bad idea but could you have a lbgui_elements mega-type struct so that all elements create with a NULL parent get assign and then any element that is assign to a parent also stores it pointer in to lbugi_elements megatype struct.
typedef struct
{
LBG_WINDOW* owner_obj;
LBG_BUTTON* my_buts[100];
LBG_WINDOW* my_wins[100];
ect.
ect.
}LBG_ELEMENTS;
#define LBG_MAX_ELEMENTS 500;
LBG_ELEMENTS* LBG_screen_elements[LBG_MAX_ELEMENTS];
void LBG_create_x(var parent,x,x,x)
{
var 1;
if(!parent)
{
for(i=0;i<LBG_MAX_ELEMENTS;i++)
{
if(i=LBG_MAX_ELEMENTS)
{
printf("LBG_MAX_ELEMENTS too small or full");
break
}
if(!LBG_screen_elements[i])
{
LBG_screen_elements[i]->owner = me;
break;
}
}
}
else
{
var j;
// find the parents LBG_screen_elements struct
for(i=0;i<LBG_MAX_ELEMENTS;i++)
{
if(LBG_screen_elements[i]->owner == parent)
{
/* find an empity struct pointer in the right
type based on create function
type e.i. LBG_create_button pass
LBG_screen_elements[i]->my_buts[j]*/
for(j=0;j<LBG_MAX_ELEMENTS;j++)
{
if(!LBG_screen_elements[i]->my_buts[j])
LBG_screen_elements[i]->my_buts[j] = my;
break;
}
// hand over point.
}
}
}
}
Then I could write a function the goes through the elements struct and set/reset(s) and panel->flags parameters.
Well I'm just a beginner and you may very well have something like this or else how could the destor() functions work.