[Next] [Previous] [Up] [Top] [Contents] [Index]
Windows and views
Creating a window
It's easy to create windows in MCL.
- Create a window.
Enter the following code in the Listener, and press Return.
(make-instance 'window)
- Set the window's title.
Enter the following code in the Listener, and press Return.
(set-window-title (target) "Echo")
The function target returns the second window. It makes it easy to use the Listener to operate on another window.
- Set the window's size.
Enter the following code in the Listener, and press Return.
(set-view-size (target) #@(240 180))
Most objects which are displayed on the screen are views. In particular, windows and items displayed in windows are views. One property shared by all views is a size. Because of this, we use the function set-view-size to set the size of a window. The window class has inherited this function from the view class. The syntax #@(i1 i2) is used to indicate point literals. In this case, we are saying the width (or horizontal coordinate) should be 240, while the height (or vertical coordinate) should be 180.
- Check the window's title.
Enter the following text in the Listener, and press Return.
(window-title (target))
Just as there are functions for setting the attributes of windows and other UI objects, there are functions for retrieving their attributes.
- Window init-keywords
-
Gettmg Started with MCL - 19 OCT 1996
[Next] [Previous] [Up] [Top] [Contents] [Index]
Generated with Harlequin WebMaker