Page 1 of 1

Parent child, previous, next gui object.

Posted: Sat Mar 09, 2024 12:36 am
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