CPlotView:AttachHandle


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

Syntax

bSuccess = CPlotView:AttachHandle( handle )

    handle is the handle of a plot 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 Plot window displayed on the Mira desktop. If you close a plot window and create a new plot window, the new window will have a different handle value. Use this method to fetch the handle of an existing GUI plot window that was saved by a previous script.

Example

The following script fetches the handle of an existing GUI plot window from the registry, attaches the handle to a CPlotView object, and then adds a new data point to the plot. It is assumed that the plot window handle was saved to the Registry by a prior script.

Reg = CRegistry:new("Real-time-phot")

-- create a link to the Registry

  --

-- get x,y, data to plot

P = CPlotView:new()

-- create a new CPlotView for the plot

handle = Reg:GetWnd( "PlotWindow" )

-- fetch the handle of the existing GUI plot window

P:AttachHandle( handle )

-- attach the handle to this CPlotView object

P:Add( x, y, ye )

-- add a new data point to the existing plot

Related Topics

GetHandle

Attach

CPlotView class

CRegistry:GetWnd