The Window is the most fundamental element of the GUI. It occupies a rectangular space on the screen within which other GUI elements (Views) are displayed.
A child view is added into a window by passing the window to the view's constructor. See View: *new.
The Window class is provided in Qt GUI for compatibility as well as convenience: e.g. unlike View, Window will be created by default in the center of the screen, and various aspects can be conveniently controlled using its constructor arguments.
Creates a new Window instance. You will need to call -front on it to become visible.
A String for the text that will be displayed in the title bar. The default is 'panel'.
A Rect specifying position and size of the window. The size does not include the border and title bar. Position is measured from the bottom-left corner of the screen (this is different than View: -bounds). The default is size 400x400 at position 128x64, but in Qt the window is centered on the screen by default.
A Boolean indicating whether this window is resizable by the user. The default is
A Boolean indicating whether this window has a border. Borderless windows have no title bar and thus can only be closed in code. The default is
This is a dummy argument which is here to provide compatibility with SwingOSC and has no effect.
A Boolean indicating whether this window will add scrollbars if its contents exceed its bounds. If this is set to
An array of all existing Window instances.
Calls -close an all existing Window instances.
The default action object to be evaluated whenever a new Window is instantiated.
Returns a Rect with the size of the screen in pixels
Returns a Rect describing the area of the screen that windows can actually occupy (i.e. excluding the Mac dock, the task bar, or similar).
When a Window is created, it creates a container view, accessible using this method, that occupies the whole area of the window, and which will be used as the actual parent of the child widgets.
Equivalent to -view
returns: The current modal sheet attached to this window, if it exists. See
Displays the window on the screen (This has the same effect as setting -visible to true).
Hides the window, only keeping its representation in the dock, taskbar, etc..
Restores the window's previous state after being minimized.
Displays the window full-screen.
Restores the window's previous state after being displayed full-screen.
Whether the window should always stay on top of other windows, even when it is not the active one.
Whether the window is visible.
Setting this to
true has the same effect as -front, and setting it to false closes the window without destroying it.
Closes and destroys the window.
A Boolean stating whether the view has been closed.
The position and size of the window. The position is relative to the bottom-left corner of the screen.
A Rect or a Point interpreted as Rect.
A convenience method that, unlike -bounds, sets the bounds by measuring position from the top-left corner of the screen, and vertically offset by
An Integer amount of pixels.
Resizes the window, keeping its position intact.
An Integer width in pixels.
An Integer height in pixels.
A Point describing the margin of the FlowLayout.
A Point describing the gap of the FlowLayout.
The new FlowLayout instance.
The title of the window.
The background color of the window.
The transparency of the window.
A Float between 0.0 (invisible) and 1.0 (opaque).
Redraws the window and all its children.
Whether the user can close the window. The default is
Whether the window receives clicks when it is not front-most. The default is
Whether the window and all its children receive mouse-over events. The default is
Just like the UserView, the window can be given a Function to evaluate whenever it is asked to redraw itself, so you can use the Pen class to draw on the window. See UserView: -drawFunc for explanation.
The action object to be evaluated whenever the window becomes the active one.
The action object to be evaluated whenever the window ceases to be the active one.
The action object to be evaluated when the window is closed.
Adds an object to -onClose, wrapping the current value into an Array, if it is not yet.
Removes an object from -onClose, if the latter is an Array.
Layouts are used to organize view sizes automatically. See: Layout Management.