Method XbpPartHandler():setParent() Foundation

Sets or returns the parent of the Xbase Part.

:setParent( [<oXbp>] ) --> oldParent
<oXbp> optionally specifies an Xbase Part as the parent of the object executing the method.

This method returns the previous parent (Xbase Part) that was current before the method was called.


The :setParent() method returns the parent of an Xbase Part or specifies a new parent. The parent is also an Xbase Part. In most cases it is the same as the return value of the function SetAppWindow() or a dialog. A parent defines a physical relationship between two Xbase Parts (the parent-child relationship). The object executing the :setParent() method is the child. Therefore, the following expression is always greater than 0:

AScan( self:setParent():childList(), self ) 

This expression illustrates that an Xbase Part always has a parent and that it is always contained in the child list of its parent. This relationship is significant when programming dialogs because the dialog and all of its elements are available, regardless of which one is referenced by a memory variable. When a reference to a dialog (XbpDialog) is contained in a memory variable oXbp, all of the Xbase Parts it contains as children are returned using oXbp:childList(). If the memory variable oXbp contains only the reference to a dialog element such as a pushbutton (XbpPushbutton), the dialog can be determined using oXbp:setParent() and the other dialog elements contained in the dialog (siblings) can be found using oXbp:setParent():childList().


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.