3 summary:: Top-level container of views
8 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.
10 A child view is added into a window by passing the window to the view's constructor. See link::Classes/View#*new::.
13 In strong::Qt GUI:: there is no distinction between windows, views, and containers; a View can be displayed directly on screen, and can contain other views. Therefore, visual descriptions of Window and most of the methods that are specific to Window in other GUI kits, also apply to and make part of View in Qt, and are thus shared by all its subclasses.
15 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.
18 The Window is usually drawn with a bar on its top edge that displays the window's title which you can set in the link::#*new#constructor::, or using link::#-name::.
28 Creates a new Window instance. You will need to call link::#-front:: on it to become visible.
31 A String for the text that will be displayed in the title bar. The default is 'panel'.
33 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 link::Classes/View#-bounds::). The default is size 400x400 at position 128x64, but in Qt the window is centered on the screen by default.
35 A Boolean indicating whether this window is resizable by the user. The default is code::true::.
37 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 code::true::.
39 This is a dummy argument which is here to provide compatibility with SwingOSC and has no effect.
41 A Boolean indicating whether this window will add scrollbars if its contents exceed its bounds. If this is set to code::true::, then link::Classes/View#-resize:: settings will be ignored for contained views. The default is false.
45 An array of all existing Window instances.
49 Calls link::#-close:: an all existing Window instances.
53 The default action object to be evaluated whenever a new Window is instantiated.
57 Returns a Rect with the size of the screen in pixels
59 METHOD:: availableBounds
61 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).
68 SUBSECTION:: View hierarchy
71 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.
77 Equivalent to link::#-view::
80 note:: Only in Cocoa GUI ::
82 The current modal sheet attached to this window, if it exists. See link::Classes/SCModalSheet::.
87 SUBSECTION:: Visibility
90 Displays the window on the screen (In Qt GUI this has the same effect as setting link::#-visible:: to true).
93 Hides the window, only keeping its representation in the dock, taskbar, etc..
96 Restores the window's previous state after being minimized.
99 Displays the window full-screen.
101 METHOD:: endFullScreen
102 Restores the window's previous state after being displayed full-screen.
105 Whether the window should always stay on top of other windows, even when it is not the active one.
111 note:: only in Qt GUI ::
113 Wether the window is visible.
115 Setting this to code::true:: has the same effect as link::#-front::, and setting it to false closes the window without destroying it.
122 Closes and destroys the window.
125 returns:: A Boolean stating whether the view has been closed.
130 SUBSECTION:: Geometry
134 The position and size of the window. The position is relative to the bottom-left corner of the screen.
137 A Rect or a Point interpreted link::Classes/Point#-asRect#as Rect::.
141 METHOD:: setTopLeftBounds
143 A convenience method that, unlike link::#-bounds::, sets the bounds by measuring position from the top-left corner of the screen, and vertically offset by code::menuSpacer::.
147 argument:: menuSpacer
148 An Integer amount of pixels.
150 METHOD:: setInnerExtent
152 Resizes the window, keeping its position intact.
154 In strong:: Qt GUI ::, this is equivalent to link::Classes/View#-resizeTo:: called on the link::#-view::.
157 An Integer width in pixels.
159 An Integer height in pixels.
162 note:: only in Qt GUI ::
163 Redirects to link::Classes/View#-sizeHint:: of the link::#-view::.
166 note:: only in Qt GUI ::
167 Redirects to link::Classes/View#-minSizeHint:: of the link::#-view::.
169 METHOD:: addFlowLayout
171 A convenience method which sets code::decorator:: of the link::#-view:: to a new instance of FlowLayout. See link::Classes/FlowLayout:: for examples.
174 A Point describing the link::Classes/FlowLayout#-margin#margin:: of the FlowLayout.
177 A Point describing the link::Classes/FlowLayout#-gap#gap:: of the FlowLayout.
179 returns:: The new FlowLayout instance.
182 note:: only in Qt GUI ::
183 Redirects to link::Classes/View#-layout:: of the link::#-view::.
187 SUBSECTION:: Appearance
190 The title of the window.
196 The background color of the window.
202 The transparancy of the window.
205 A Float between 0.0 (invisible) and 1.0 (opaque).
208 Redraws the window and all its children.
212 SUBSECTION:: Interaction
214 METHOD:: userCanClose
215 Whether the user can close the window. The default is code::true::.
220 METHOD:: acceptsClickThrough
221 Whether the window receives clicks when it is not front-most. The default is code::true::.
226 METHOD:: acceptsMouseOver
227 Whether the window receives mouse-over events. The default is code::false::.
234 SUBSECTION:: Actions and hooks
237 Just like the link::Classes/UserView::, the window can be given a Function to evalute whenever it is asked to redraw itself, so you can use the link::Classes/Pen:: class to draw on the window. See link::Classes/UserView#-drawFunc:: for explanation.
242 METHOD:: toFrontAction
244 The action object to be evaluated whenever the window becomes the active one.
246 METHOD:: endFrontAction
248 The action object to be evaluated whenever the window ceases to be the active one.
252 The action object to be evaluated when the window is closed.
254 METHOD:: addToOnClose
256 Adds an object to link::#-onClose::, wrapping the current value into an Array, if it is not yet.
258 METHOD:: removeFromOnClose
260 Removes an object from link::#-onClose::, if the latter is an Array.