CTextView:AttachHandle
The AttachHandle method attaches a window handle to this CTextView object. The handle may have been obtained from the System Registry using the CRegistry:GetWnd method.
success = CTextView:AttachHandle( handle ) |
handle is the handle of a text window displayed on the Mira desktop.
On success, returns true; on failure it returns false.
The window handle applies only to a specific Text window displayed on the Mira desktop. If you close a text window and create a new text window, the new window will have a different handle value. Use this method to fetch the handle of an existing GUI text window that was saved by a previous script.
The following script fetches the handle of an existing GUI text window from the registry, attaches the handle to a CTextView object, and then prints a new string in the window. It is assumed that the text window's handle was saved to the Registry by a prior script.
|
-- create a link to the Registry |
-- |
-- get a string, s, to list |
|
-- create a new CTextView for the string |
|
-- fetch the handle of the existing GUI text window |
|
-- attach the handle to this CTextView object |
|
-- add the string to the existing text window |