top-level-window<%> : interface? | ||
|
(send a-top-level-window can-close?) → boolean?
This method is not called by show.
Default implementation: Calls can-close? and returns the result.
(send a-top-level-window center [direction]) → void? direction : (one-of/c 'horizontal 'vertical 'both) = 'both
If direction is 'horizontal, the window is centered horizontally. If direction is 'vertical, the window is centered vertically. If direction is 'both, the window is centered in both directions.
(send a-top-level-window get-edit-target-object) → (or/c (or/c (is-a?/c window<%>) (is-a?/c editor<%>)) false/c)
See also get-focus-object.
See also get-focus-window and get-edit-target-object.
(send a-top-level-window get-eventspace) → eventspace?
(send a-top-level-window get-focus-object) → (or/c (or/c (is-a?/c window<%>) (is-a?/c editor<%>)) false/c)
See also get-edit-target-object.
See also get-edit-target-window and get-focus-object.
(send a-top-level-window move x y) → void? x : (integer-in -10000 10000) y : (integer-in -10000 10000)
A window’s position can be changed by the user dragging the window, and such changes do not go through this method; use on-move to monitor position changes.
(send a-top-level-window on-activate active?) → void? active? : any/c
The method’s argument is #t when the window is activated, #f when it is deactivated.
See also can-close?.
Default implementation: Calls on-close and then show to hide the window.
(send a-top-level-window on-message message) → any/c message : any/c
If the method is invoked by send-message-to-window, then it is invoked in the thread where send-message-to-window was called (which is possibly not the handler thread of the window’s eventspace).
Default implementation: Returns #<void>.
(send a-top-level-window on-traverse-char event) → boolean? event : (is-a?/c key-event%)
Default implementation: The following rules determine, in order, whether and how event is handled:
- If the window that currently owns the focus specifically handles the event, then #f is returned. The following describes window types and the keyboard events they specifically handle:
editor-canvas% —
tab-exit is disabled (see allow-tab-exit): all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed; when tab-exit is enabled: all keyboard events except Tab, Enter, Escape, and alphanumeric Meta/Alt events. canvas% —
when tab-focus is disabled (see accept-tab-focus): all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed; when tab-focus is enabled: no key events text-field%, 'single style —
arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed (and all alphanumeric events on Mac OS X) text-field%, 'multiple style —
all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed choice% —
arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed list-box% —
arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed
If event is a Tab or arrow key event, the keyboard focus is moved within the window and #t is returned. Across platforms, the types of windows that accept the keyboard focus via navigation may vary, but text-field% windows always accept the focus, and message%, gauge%, and panel% windows never accept the focus.
If event is a Space key event and the window that currently owns the focus is a button%, check-box%, or radio-box% object, the event is handled in the same way as a click on the control and #t is returned.
If event is an Enter key event and the current top-level window contains a border button, the button’s callback is invoked and #t is returned. (The 'border style for a button% object indicates to the user that pressing Enter is the same as clicking the button.) If the window does not contain a border button, #t is returned if the window with the current focus is not a text field or editor canvas.
In a dialog, if event is an Escape key event, the event is handled the same as a click on the dialog’s close box (i.e., the dialog’s can-close? and on-close methods are called, and the dialog is hidden) and #t is returned.
If event is an alphanumeric key event and the current top-level window contains a control with a mnemonic matching the key (which is installed via a label that contains &; see get-label for more information), then the keyboard focus is moved to the matching control. Furthermore, if the matching control is a button%, check-box%, or radio-box% button, the keyboard event is handled in the same way as a click on the control.
Otherwise, #f is returned.
(send a-top-level-window on-system-menu-char event) → boolean? event : (is-a?/c key-event%)
(send a-top-level-window resize width height) → void? width : (integer-in 0 10000) height : (integer-in 0 10000)
A window’s size can be changed by the user, and such changes do not go through this method; use on-size to monitor size changes.
(send a-top-level-window set-icon icon [ mask which]) → void? icon : (is-a?/c bitmap%) mask : (is-a?/c bitmap%) = #f which : (one-of/c 'small 'large 'both) = 'both
The icon is used in a platform-specific way:
Windows —
the small icon is used for the window’s icon (in the top-left) and in the task bar, and the large icon is used for the Alt-Tab task switcher. Mac OS X —
both icons are ignored. Unix —
many window managers use the small icon in the same way as Windows, and others use the small icon when iconifying the frame; the large icon is ignored.
The bitmap for either icon can be any size, but most platforms scale the small bitmap to 16 by 16 pixels and the large bitmap to 32 by 32 pixels.
If a mask bitmap is not provided, then the entire (rectangular) bitmap is used as an icon.
If a mask bitmap is provided, the mask must be monochrome. In the mask bitmap, use black pixels to indicate the icon’s region and use white pixels outside the icon’s region. In the icon bitmap, use black pixels for the region outside the icon.