GetTreeControl

>>-anAdvancedControl~GetTreeControl(--id--+-------------+--)---><
                                          +-,--category-+


The GetTreeControl method returns an object of the TreeControl class that is assigned to the tree view with the specified ID. The TreeControl class (see TreeControl Class) provides methods to query and manipulate tree views.

Arguments:

The arguments are:

id

The ID of the tree view.

category

The number of the category dialog page containing the requested tree view. This argument must only be specified for category dialogs.

Return value:

An object of the TreeControl class or .Nil if the requested tree view does not exist.

Example:

The following example initializes tree view 101 by sending message ADD to object "tc", which is assigned to 101 by using GetTreeControl:

::class MyDlgClass subclass UserDialog inherit AdvancedControls

::method InitDialog
  tc = self~GetTreeControl(101)
  if tc == .Nil then return
  tc~Add("Root 1")
  tc~Add(  ,"Item 1")
  tc~Add(  ,"Item 2")
  tc~Add(  ,"Item 3")
  tc~Add("Root 2", , ,"EXPANDED")
  tc~Add(  ,"Item 4", , ,"BOLD")
  tc~Add(  ,"Item 5")
  tc~Add(  ,"Subroot")
  tc~Add(  ,    ,"Item 6",3)

Note: GetTreeControl connects an Object Rexx object with a Windows object. If the object does not exist, the Nil object is returned. Therefore, this method can only be applied after the Windows dialog has been created (after the invocation of StartIt).