Doing some layout class

Online Status

Hello again,
Merry Christmas also. 🎅

... Let's says... like if ... I needed to code my own Layout class... for some purpose.
I couldn't find any example to do that anywhere, but I guess most job is in GM_LAYOUT...
... and well I was asking myself 2 questions so far:

- Is gadget recursion managed in a layout done by intuition methods "AddGadget() / RemoveGadget() ", or by just using DoGadgetMethod() recursively for all GM_XX methods ?
Isn't calling DoGadgetMethod() recursively under a GM_RENDER dangerous ?

- Let's say: I add or remove a gadget under my own layout, how do I send refresh message to myself so it reaches GM_LAYOUT , like when resize is done ?

Thank youhappy new year also

Online Status

... blogging a bit about how long it took me to find out a reliable way to just refresh my gadget so it uses GM_LAYOUT and GM_RENDER with a correct signal... The idea is that layouting and rendering needs absolutely a correct GadgetInfo that is passed recursively during draw, but can't be generated externally.
So well, I added a MYGADGET_Refresh attribute, then a refresh from external source would be just: SetGadgetAttrs(obj, window, NULL, MYGADGET_Refresh ,TRUE,TAG_END);
... then in my private gadget TrackListArea_SetAttrs() , I have a struct opSet *Set with set->ops_GInfo , and there it is, a correct Gadget Info, then I go like;

case MYGADGET_Refresh:
{
// goes layout...
{
struct gpLayout gpl;
gpl.MethodID = GM_LAYOUT;
gpl.gpl_GInfo = Set->ops_GInfo;
gpl.gpl_Initial = 0;
TrackListArea_Layout(C,Gad,&gpl);
}
// goes render...
{
struct gpRender gpr;
gpr.MethodID = GM_RENDER;
gpr.gpr_GInfo = Set->ops_GInfo;
gpr.gpr_RPort = ObtainGIRPort(gpr.gpr_GInfo);
if(gpr.gpr_RPort)
{
gpr.gpr_Redraw = 1;
TrackListArea_Render(C,Gad,&gpr);
ReleaseGIRPort(gpr.gpr_RPort);
}
}
}
break;