Class | Fox::FXApp |
In: |
rdoc-sources/FXApp.rb
|
Parent: | FXObject |
Application Object
The FXApp object itself doesn‘t have a designated message target like other FOX objects, but it can send messages to objects for a few special events.
INPUT_NONE: | inactive |
INPUT_READ: | read input fd |
INPUT_WRITE: | write input fd |
INPUT_EXCEPT: | except input fd |
MODAL_FOR_NONE: | Non modal event loop (dispatch normally) |
MODAL_FOR_WINDOW: | Modal dialog (beep if outside of modal dialog) |
MODAL_FOR_POPUP: | Modal for popup (always dispatch to popup) |
These constants symbolically represent the different cursor shapes used in FOX applications, and can be used as the which arguments for getDefaultCursor and setDefaultCursor.
DEF_ARROW_CURSOR: | Arrow cursor |
DEF_RARROW_CURSOR: | Reverse arrow cursor |
DEF_TEXT_CURSOR: | Text cursor |
DEF_HSPLIT_CURSOR: | Horizontal split cursor |
DEF_VSPLIT_CURSOR: | Vertical split cursor |
DEF_XSPLIT_CURSOR: | Cross split cursor |
DEF_SWATCH_CURSOR: | Color swatch drag cursor |
DEF_MOVE_CURSOR: | Move cursor |
DEF_DRAGH_CURSOR: | Resize horizontal edge |
DEF_DRAGV_CURSOR: | Resize vertical edge |
DEF_DRAGTL_CURSOR: | Resize upper-leftcorner |
DEF_DRAGBR_CURSOR: | Resize bottom-right corner |
DEF_DRAGTR_CURSOR: | Resize upper-right corner |
DEF_DRAGBL_CURSOR: | Resize bottom-left corner |
DEF_DNDSTOP_CURSOR: | Drag and drop stop |
DEF_DNDCOPY_CURSOR: | Drag and drop copy |
DEF_DNDMOVE_CURSOR: | Drag and drop move |
DEF_DNDLINK_CURSOR: | Drag and drop link |
DEF_CROSSHAIR_CURSOR: | Cross hair cursor |
DEF_CORNERNE_CURSOR: | North-east cursor |
DEF_CORNERNW_CURSOR: | North-west cursor |
DEF_CORNERSE_CURSOR: | South-east cursor |
DEF_CORNERSW_CURSOR: | South-west cursor |
DEF_HELP_CURSOR: | Help arrow cursor |
DEF_HAND_CURSOR: | Hand cursor |
DEF_ROTATE_CURSOR: | Rotate cursor |
DEF_WAIT_CURSOR: | Wait cursor |
ID_QUIT: | Terminate the application normally |
ID_DUMP: | Dump the current widget tree |
activeWindow | [R] | The active top-level window, if any [FXWindow] |
animSpeed | [RW] | Animation speed, in milliseconds [Integer] |
appName | [R] | Application name [String] |
argc | [R] | Argument count [Integer] |
argv | [R] | Argument vector [Array] |
backColor | [RW] | Default background color [FXColor] |
baseColor | [RW] | Background color of GUI controls [FXColor] |
blinkSpeed | [RW] | Blink speed, in milliseconds [Integer] |
borderColor | [RW] | Border color [FXColor] |
clickSpeed | [RW] | Click speed, in milliseconds [Integer] |
cursorWindow | [R] | The window under the cursor, if any [FXWindow] |
defaultVisual | [RW] | Default visual [FXVisual] |
display | [R] | Display [Integer] |
dragDelta | [RW] | Drag delta, in pixels [Integer] |
focusWindow | [R] | The window at the end of the focus chain, if any [FXWindow] |
foreColor | [RW] | Default foreground color [FXColor] |
hiliteColor | [RW] | Hilite color of GUI controls [FXColor] |
mainWindow | [R] | The main window, if any [FXWindow] |
menuPause | [RW] | Menu pause, in milliseconds [Integer] |
modalModality | [R] | Mode of current modal loop [Integer] |
modalWindow | [R] | The window of the current modal loop [FXWindow] |
monoVisual | [R] | Monochrome visual [FXVisual] |
normalFont | [RW] | Default font [FXFont] |
rootWindow | [R] | Root window [FXRootWindow] |
scrollBarSize | [RW] | Scroll bar size [Integer] |
scrollDelay | [RW] | Scroll delay time, in milliseconds [Integer] |
scrollSpeed | [RW] | Scroll speed, in milliseconds [Integer] |
selMenuBackColor | [RW] | Default background color for selected menu items [FXColor] |
selMenuTextColor | [RW] | Default text color for selected menu items [FXColor] |
selbackColor | [RW] | Default background color for selected objects [FXColor] |
selforeColor | [RW] | Default foreground color for selected objects [FXColor] |
shadowColor | [RW] | Shadow color of GUI controls [FXColor] |
sleepTime | [RW] | Amount of time (in milliseconds) to yield to Ruby‘s thread scheduler [Integer] |
tipbackColor | [RW] | Default background color for tooltips [FXColor] |
tipforeColor | [RW] | Default foreground color for tooltips [FXColor] |
tooltipPause | [RW] | Tooltip pause, in milliseconds [Integer] |
tooltipTime | [RW] | Tooltip time, in milliseconds [Integer] |
translator | [RW] | Message translator [FXTranslator] |
typingSpeed | [RW] | Typing speed used for the FXIconList, FXList and FXTreeList widgets’ lookup features, in milliseconds. Default value is 1000 milliseconds. |
vendorName | [R] | Vendor name [String] |
waitCursor | [RW] | Wait cursor [FXCursor] |
wheelLines | [RW] | Number of wheel lines [Integer] |
Construct application object; the appName and vendorName strings are used as keys into the registry database for this application‘s settings. Only one single application object can be constructed.
Add signal processing message to be sent to target object when the signal sig is raised; flags are to be set as per POSIX definitions. When immediate is true, the message will be sent to the target right away; this should be used with extreme care as the application is interrupted at an unknown point in its execution.
Return a reference to one of the default application cursors (an FXCursor instance), where which is one of the default cursor identifiers listed above, e.g.
rotateCursor = app.getDefaultCursor(DEF_ROTATE_CURSOR)
See also setDefaultCursor.
Return the name of a previously registered drag type, e.g.
dragTypeName = app.getDragTypeName(yamlDragType)
See also registerDragType.
Initialize application. Parses and removes common command line arguments, reads the registry. Finally, if connect is true, it opens the display.
Return a reference to the application-wide mutex (an FXMutex instance). Normally, the main user interface thread holds this mutex, insuring that no other threads are modifying data during the processing of user interface messages. However, whenever the main user interface thread blocks for messages, it releases this mutex, to allow other threads to modify the same data. When a new message becomes available, the main user interface thread regains the mutex prior to dispatching the message. Other threads should hold this mutex only for short durations, so as to not starve the main user interface thread.
Return a reference to the registry (an FXRegistry instance). The registry keeps settings and configuration information for an application, which are automatically loaded when the application starts up, and saved when the application terminates.
Register a drag type with the given name and return the drag drag type. If this drag type has already been registered, this method will return the previously returned drag type. For example,
yamlDragType = app.registerDragType("application/x-yaml")
See also getDragTypeName.
Remove input message and target object for the specified file descriptor and mode, which is a bitwise OR of (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).
Run modal event loop, blocking keyboard and mouse events to all windows until stopModal is called.
Run event loop while there are events are available in the queue. Returns 1 when all events in the queue have been handled, and 0 when the event loop was terminated due to stop or stopModal. Except for the modal window and its children, user input to all windows is blocked; if the modal window is nil, all user input is blocked.
Run event loop while events are available, non-modally. Return when no more events, timers, or chores are outstanding.
Replace one of the default application cursors with cursor; e.g
app.setDefaultCursor(DEF_ROTATE_CURSOR, myRotateCursor)
See also getDefaultCursor.
Terminate the outermost event loop, and all inner modal loops; All more deeper nested event loops will be terminated with code equal to 0, while the outermost event loop will return code equal to value.
Break out of the matching modal loop, returning code equal to value. All deeper nested event loops are terminated with code equal to 0.