CreateTextWindow
The CreateTextWindow function opens a new Mira Text Editor window. The title and size can be specified.
pointer = CreateTextWindow( sTitle=nil, CRect=nil )
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 fragment 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 |