CGrid:AttachHandle


The AttachHandle method attaches a window handle to this CGridView object. The handle may have been obtained from the System Registry using the CRegistry:GetWnd method.

Syntax

bSuccess = CGridView:AttachHandle( handle )

where

    handle is the handle of a grid window displayed on the Mira desktop.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

The window handle applies only to a specific grid window displayed on the Mira desktop. If you close an grid window and create a new grid window, the new window will have a different handle value. Use this method to fetch the handle of an existing GUI grid window that was saved by a previous script.

Example

The following script fetches the handle of an existing GUI grid window from the registry, attaches the handle to a CGridView object, and then displays a new CGrid in the window. It is assumed that the grid window's handle was saved to the Registry by a prior script.

 

Reg = CRegistry:new("GridData")

-- create a link to the Registry

  --

-- get a CGrid, G, to display

V = CGridView:new()

-- create a new CGridView object

handle = Reg:GetWnd( "GridWindow" )

-- fetch the handle of the existing GUI grid window

V:AttachHandle( handle )

-- attach the handle to this CGridView object

V:Display( G )

-- display the CGrid in the existing grid window

Related Topics

GetHandle

CGridView class

CRegistry:GetWnd