frame% : class? | ||
superclass: object% | ||
|
On Windows, both Multiple Document Interface (MDI) and Single Document Interface (SDI) frames are supported.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
→ (is-a?/c frame%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label : label-string? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parent : (or/c (is-a?/c frame%) false/c) = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
width : (or/c (integer-in 0 10000) false/c) = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
height : (or/c (integer-in 0 10000) false/c) = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
x : (or/c (integer-in -10000 10000) false/c) = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
y : (or/c (integer-in -10000 10000) false/c) = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabled : any/c = #t | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
border : (integer-in 0 1000) = 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
spacing : (integer-in 0 1000) = 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
min-width : (integer-in 0 10000) = graphical-minimum-width | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
min-height : (integer-in 0 10000) = graphical-minimum-height | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stretchable-width : any/c = #t | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stretchable-height : any/c = #t |
The parent argument can be #f or an existing frame. On Windows, if parent is an existing frame, the new frame is always on top of its parent. Also, the parent frame may be an MDI parent frame from a new MDI child frame. On Windows and Unix (for many window managers), a frame is iconized when its parent is iconized.
If parent is #f, then the eventspace for the new frame is the current eventspace, as determined by current-eventspace. Otherwise, parent’s eventspace is the new frame’s eventspace.
If the width or height argument is not #f, it specifies an initial size for the frame (in pixels) assuming that it is larger than the minimum size, otherwise the minimum size is used.
If the x or y argument is not #f, it specifies an initial location for the frame. Otherwise, a location is selected automatically (tiling frames and dialogs as they are created).
The style flags adjust the appearance of the frame on some platforms:
'no-resize-border —
omits the resizeable border around the window (Windows, Unix) or grow box in the bottom right corner (Mac OS X) 'no-caption —
omits the title bar for the frame (Windows, Mac OS X, Unix) 'no-system-menu —
omits the system menu (Windows) 'mdi-child —
creates the frame as a MDI (multiple document interface) child frame, mutually exclusive with 'mdi-parent (Windows) 'mdi-parent —
creates the frame as a MDI (multiple document interface) parent frame, mutually exclusive with 'mdi-child (Windows) 'toolbar-button —
includes a toolbar button on the frame’s title bar (Mac OS X); a click on the toolbar button triggers a call to on-toolbar-button-click 'hide-menu-bar —
hides the menu bar and dock when the frame is active (Mac OS X) or asks the window manager to make the frame fullscreen (Unix) 'float —
causes the frame to stay in front of all other non-floating windows (Windows, Mac OS X, Unix); on Mac OS X, a floating frame shares the focus with an active non-floating frame; when this style is combined with 'no-caption, then showing the frame does not cause the keyboard focus to shift to the window, and on Unix, clicking the frame does not move the focus; on Windows, a floating frame has no taskbar button 'metal —
ignored (formerly supported for Mac OS X)
If the 'mdi-child style is specified, the parent must be a frame with the 'mdi-parent style, otherwise an exn:fail:contract exception is raised.
Even if the frame is not shown, a few notification events may be queued for the frame on creation. Consequently, the new frame’s resources (e.g., memory) cannot be reclaimed until some events are handled, or the frame’s eventspace is shut down.
For information about the enabled argument, see window<%>. For information about the border, spacing, and alignment arguments, see area-container<%>. For information about the min-width, min-height, stretchable-width, and stretchable-height arguments, see area<%>.
(send a-frame create-status-line) → void? |
See also set-status-text.
(send a-frame has-status-line?) → boolean? |
A frame’s iconization can be changed by the user, and such changes do not go through this method. A program cannot detect when a frame has been iconized except by polling is-iconized?.
(send a-frame is-iconized?) → boolean? |
(send a-frame is-maximized?) → boolean? |
A window’s maximization can be changed by the user, and such changes do not go through this method; use on-size to monitor size changes.
Default implementation: If maximize? is #f, the window is restored, otherwise it is maximized.
(send a-frame on-mdi-activate active?) → void? |
active? : any/c |
MDI activation is different from keyboard-focus activation. If the parent frame is the frontmost top-level frame, so that the MDI child gets or loses the keyboard focus, then a separate on-activate notification is sent to the MDI-child frame.
(send a-frame on-menu-char event) → boolean? |
event : (is-a?/c key-event%) |
When the match corresponds to a complete shortcut combination, the menu item’s callback is called (before on-menu-char returns).
If the event does not correspond to a complete shortcut combination, the event may be handled anyway if it corresponds to a mnemonic in the menu bar (i.e., an underlined letter in a menu’s title, which is installed by including an ampersand in the menu’s label). If a mnemonic match is found, the keyboard focus is moved to the menu bar (selecting the menu with the mnemonic), and #t is returned.
| ||||||||||||||
receiver : (is-a?/c window<%>) | ||||||||||||||
event : (is-a?/c key-event%) |
(or (send this on-menu-char event) (send this on-system-menu-char event) (send this on-traverse-char event))
(send a-frame on-toolbar-button-click) → void? |
(send a-frame 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 frame’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.
(send a-frame set-status-text text) → void? |
text : string? |