Parent child, previous, next gui object.

Just starting out? Need help? Post your questions and find answers here.
Webarion
Posts: 7
Joined: Mon Mar 04, 2024 10:47 pm

Parent child, previous, next gui object.

Post by Webarion »

For SpiderBasic, I'm creating an algorithm similar to Dock positioning. And here I need GetParent, SetParent(Object). And also PrevObject and NextObject.
The question is how to understand the structure of parent and child objects, because the spider.window and spider.gadget objects are parallel in spider (JavaScript) and are not nested. It's wrong to track this through the DOM because the spider object has a private structure.

How do I iterate over a tree of parent and child objects, similar to a structure:

Code: Select all

;  Window1      ; -  GetParent = Desktop
;    Container1 ; -  GetParent = Window1
;      Gadget1  ; -  GetParent = Container1
;      Gadget2  ; -  GetParent = Container1
;    Container2 ; -  GetParent = Window1
;      Gadget3  ; -  GetParent = Container2
;    Panel1     ; -  GetParent = Window1
;      Gadget5
;  Window2  -   ; GetParent = Desktop
;    Gadget6