The ConnectTreeControl method creates a new attribute and connects it to the tree view id. The attribute has to be synchronized manually with the tree view. You can do this globally using the SetData and GetData methods or methods provided by the TreeControl class. A tree view can contain many items. When the dialog data is set, the first tree view item containing the same text as the text stored in the connected attribute, is selected. When the data is received, the attribute receives the text of the selected tree view item. Usually, the connection is made automatically and you do not have to use this method.
The arguments are:
The ID of the tree view that you want to connect.
An unused valid Rexx symbol because an attribute with exactly this name is added to the dialog object by this method. Blank spaces, ampersands (&), and colons (:) are removed from the attributeName.
If this argument is omitted, is not valid, or already exists, the following occurs:
If the ID is numeric, an attribute with the name DATAid is used, where id is the value of the first argument.
If the ID is symbolic, the attribute is named as the ID.
In the following example, the tree view with ID 202 is associated with the attribute FileName. Then TEST.REX is assigned to the newly created attribute. Then the dialog is executed, which preselects TEST.REX in the tree view, if it exits. After the dialog is terminated, the selected entry of the tree view is copied to the attribute FileName.
MyDialog~ConnectTreeControl(202, "FileName") MyDialog~FileName="TEST.REX" MyDialog~Execute("SHOWTOP") say MyDialog~FileName