CGridView:Attach


The Attach method attaches the top most window (a grid window) to the script and creates a new CGridView object for it.

Syntax

NewGridView_Object = CGridView:Attach()

where

    NewGridView_Object is a new CGridView object. On failure, nil is returned.

  

Use Attach to run the script on the top-most grid window. To do this, bring the target window to the top of the stack and run the script using the [!]button on the main toolbar.

Note: This method creates a new CGridView object so the new constructor should not be called for this object.

Example

Suppose the script works with an grid set displayed in the top-most window. The following script attaches the top-most window (an grid window) to the script and selects the 2nd grid from the set:

V = CGridView:Attach()

-- attach the existing grid window

G = V:Getgrid( 2 )

-- get a pointer to the 2nd grid

Related Topics

AttachFromList

GetViewPtr

CGridView class