FXApp

Application Object


FXApp(name=Application, vendor=FoxDefault)

Copyright notice of library.

Construct application object; the name and vendor strings are used as keys into the registry database for this application's settings

ArgumentTypeDefaultDescription
nameStringApplication 
vendorStringFoxDefault 


addChore(tgt, sel)

Add a idle processing message to be sent to target object when the system becomes idle, i.e. there are no events to be processed.

ArgumentTypeDefaultDescription
tgtFXObject  
selInt  


addInput(fd, mode, tgt, sel)

Add a file descriptor fd to be watched for activity as determined by mode, where mode is a bitwise OR (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT). A message of type SEL_IO_READ, SEL_IO_WRITE, or SEL_IO_EXCEPT will be sent to the target when the specified activity is detected on the file descriptor.

On Windows, a Win32 event, not a file descriptor, must be specified. The client code for this interface must be platform-dependent. See addSocket below for a portable interface. CAE

ArgumentTypeDefaultDescription
fdFXInputHandle  
modeInt  
tgtFXObject  
selInt  


addSocket(sd, mode, tgt, sel)

CAE Add a socket descriptor sd to be watched for activity as determined by mode, where mode is a bitwise OR (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT). A message of type SEL_IO_READ, SEL_IO_WRITE, or SEL_IO_EXCEPT will be sent to the target when the specified activity is detected on the socket descriptor.

This is identical to addInput on Unix. It behaves the same on Windows.

ArgumentTypeDefaultDescription
sdSOCKET  
modeInt  
tgtFXObject  
selInt  


addTimeout(ms, tgt, sel)

Add timeout message to be sent to target object in ms milliseconds; the timer fires only once after the interval expires.

ArgumentTypeDefaultDescription
msInt  
tgtFXObject  
selInt  


beep()

Beep.


beginWaitCursor()

Begin of wait-cursor block; wait-cursor blocks may be nested.


create()

Create application's windows.

Reimplemented in AFXApp.


endWaitCursor()

End of wait-cursor block.


forceRefresh()

Force GUI refresh.


getAppName()

Get application name.


getBorderColor()

Obtain default colors.


getMainWindow()

Get main window, if any.


getMonoVisual()

Get monochrome visual.


getNormalFont()

Return default font.


getRoot()

Get root Window.


getTypingSpeed()

Obtain application-wide settings.


init(argc, argv, connect=True)

Initialize application. Parses and removes common command line arguments, reads the registry. Finally, if connect is True, it opens the display.

ArgumentTypeDefaultDescription
argcInt  
argvString  
connectBoolTrue 


peekEvent()

Peek to determine if there's an event.


refresh()

Schedule a refresh.


removeChore(c)

Remove idle processing message.

ArgumentTypeDefaultDescription
cFXChore  


removeInput(fd, mode)

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).

ArgumentTypeDefaultDescription
fdFXInputHandle  
modeInt  


removeSocket(sd, mode)

CAE Remove input message and target object for the specified socket descriptor and mode, which is a bitwise OR of (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).

ArgumentTypeDefaultDescription
sdSOCKET  
modeInt  


removeTimeout(t)

Remove timeout, returns NULL.

ArgumentTypeDefaultDescription
tFXTimer  


repaint()

Paint all windows marked for repainting. On return all the applications windows have been painted.


run()

Run the main application event loop until stop() is called, and return the exit code passed as argument to stop().

Reimplemented in AFXApp.


runOneEvent()

Perform one event dispatch.


runUntil(condition)

Run an event loop till some flag becomes non-zero.

Reimplemented in AFXApp.

ArgumentTypeDefaultDescription
conditionInt  


runWhileEvents(window=None)

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 NULL all user input is blocked.

ArgumentTypeDefaultDescription
windowFXWindowNone 


setBorderColor(color)

Change default colors.

ArgumentTypeDefaultDescription
colorFXColor  


setNormalFont(font)

Change default font.

ArgumentTypeDefaultDescription
fontFXFont  


setTypingSpeed(speed)

Change application-wide settings.

ArgumentTypeDefaultDescription
speedInt  


stop(value=0)

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.

ArgumentTypeDefaultDescription
valueInt0 


useWidgetBackColor(state)

CAE Begin.

On Windows only, a widget's background color is normally obtained from the desktop theme, even if the widget's background color has been set using its setBackColor method. The useWidgetBackColor method allows customizers to override that behavior and have the application use the color set by a widget's setBackColor method instead. It is not necessary to use this method if the Windows Classic theme is used.

ArgumentTypeDefaultDescription
stateBool  


Class flags

Messages applications understand.

ID_QUIT

Terminate the application normally.

ID_DUMP

Dump the current widget tree.


Global flags

File input modes for addInput

INPUT_NONE

Inactive.

INPUT_READ

Read input fd.

INPUT_WRITE

Write input fd.

INPUT_EXCEPT

Except input fd.

All ways of being modal

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).

Default cursors provided by the application

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_ROTATE_CURSOR

Rotate cursor.