CreateTextWindow
The CreateTextWindow function opens a new Mira Text Editor window. The title and size can be specified.
pointer = CreateTextWindow( sTitle=nil, CRect=nil )
sTitle is a string that specifies the window caption. if nil, a default is used.
CRect is a rectangle specifying the fractional dimensions of the window in terms of the Mira viewport. All CRect members must be between 0 and 1. If CRect is not specified or is nil, then a default window size is used.
On success, this method returns a pointer to the Mira Text Window.
On failure, nil is returned.
This is a global version of the CTextView class new method. After creating the text window using this function, you can use the global Wprintf function to write to the window. If a Text Editor window already exists with the specified name, this function returns a reference to the existing window. Otherwise, a new Text Editor is created.
Note that the CRect argument specifies a window size in terms of the current Mira viewport (the main window size). For example, if CRect contains the dimensions (0.1, 0.7, 0.1, 0.7), then a window will be created that extends from 10% to 70% of the viewport size.
The following script opens a Mira Text Editor window with the specified title:
|
-- create a new instance T of the CTextView class. |
|
-- write to the window by passing its pointer, ptr |
The next example creates a new CTextView with a specified title and size
|
-- window title |
|
-- window rectangle relative to main window |
|
-- create a new window with title and size |
|
-- write to the window by passing its pointer, ptr |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.