Get object reference attached to a parent

Hello,
Lets say I created dhtmlxWindow, attached dhtmlxLayout to it and attached dhtmlxToolbar to Layout. Later on, in another function I need to refresh layout content and refresh toolbar status, all I have is a reference to a window. How do I get a reference to a layout object via window object layout is attached to, is there a child/parent properties of window object, same goes to toolbar object I need to get reference using layout object. I guess in a general sense, I need to know is there is a way to get reference to all/any attached dhtmlx object only via a parent object. I know there is a ton of undocumented tricks.
Thanks in advanve, by the way I use v3.6

Hello
You just need to use
w1 = dhxWins.createWindow(“w1”, 20, 30, 400, 280);
myLayout = w1.attachLayout(“2E”);
myToolbar = myLayout.cells(“a”).attachToolbar({…})

myLayout and myToolbar will be your “links” to these objects

I understand that, objects myLayout and myToolbar are created in the function and are local variables in that function, I could create global variables for them, but I’d rather prefer not to do that. So in another function I have access to global variable w1 and from that I would like to get reference to all/some objects attached to w1. Sort of like get all children(attached dhtmlx components to w1) for w1.
Thanks

Sorry, but described approach is the only way to access attached component.