Contents Up Previous Next

Application

One object of class 'application' is always present, and its implementation depends upon the C++ application hosting the wxCLIPS environment.

If an application defines a function called app-on-init, the wxCLIPS user interface can start up the application from a standard menu item, or straightaway if the -start flag is used on the command line. This function is not relevant to embedded versions of wxCLIPS.

If app-on-init is defined, it must initialize the main frame and return its integer identifier, or zero if the application could not be initialized.

The following callbacks are valid for the app class.

OnCharHook
Under Windows only, all key strokes going to a dialog box or frame can be intercepted before being passed on for normal processing. This callback function takes the window id and event id, and should return 1 to override further processing, or 0 to do default processing. If the function returns 0, the OnCharHook message will be sent to the active window. See also Key event.

app-create
app-get-show-frame-on-init
app-on-init
app-set-show-frame-on-init


app-create

long ( app-create)

Returns the identifier of the current application object. If called multiple times, will always return the same number since there is only one application object, which will have been created before wxCLIPS is initialized.


app-get-show-frame-on-init

long ( app-get-show-frame-on-init long id)

Returns 1 if the application will show the top-level frame automatically on initialization, 0 otherwise.

You can pass 0 or a return value from app-create for the id parameter.


app-on-init

long ( app-on-init)

If defined, should initialize the application and return the identifer of the top-level frame, or zero if there is no main window associated with the CLIPS program. If zero is returned, the wxCLIPS development window will be created if it does not already exist. Under Windows, you may call show-ide-window from this function.


app-set-show-frame-on-init

void ( app-set-show-frame-on-init long id long show)

Called before on-app-init returns, can change the behaviour of wxCLIPS to not force a 'show' of the main frame. This might be needed if you wish to set the focus for a different window on initialization. show should be 0 to disable showing, 1 otherwise (the default behaviour).

You can pass 0 or a return value from app-create for the id parameter.