CGridView:Attach CGridView:AddSheet

CGridView:AttachFromList


The AttachFromList method creates a new CGridView object attached to a grid window on the Mira desktop. The script can then collect data from the grid and change its contents. This function requires the user to select the target window from a list of all grid windows on the desktop. This function does not use an existing CTextView object. Also see the equivalent non-class function attachlist_gridview. Since a new CGridView object is created by this method, you must call it using the CGridView class name rather than an existing object (see the example below).

The related attach_gridview function attaches the top-most grid window.

Syntax

CGridView_obj = CGridView:AttachFromList()

bullet.gif    On success, a new CGridView class object is returned.

bullet.gif    On failure, nil is returned. This usually means no grid window is shown on the Mira desktop.

Remarks

This function collects all grid windows on the Mira desktop into a list, then displays them in a window where the target grid window is selected. The selected grid window is returned as a new CGridView object.

Example

Assume that several grid windows are displayed on the Mira desktop along with other windows. The following script attaches one of these grid windows to the script:

G = CGridView:AttachFromList()

-- select the target grid window

if G == nil then Exit() end

-- if not successful, exit the script

Printf("Attached grid %s\n")

-- print the title of the attached window

Related Topics

CGridView class

new

attachlist_gridview


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.