5 The MLWorks Motif Interface Library

5.7 Initialization

Xm must be initialized using the initialize function. This may be called both interactively and from stand-alone applications. It handles the housekeeping of initializing the X Toolkit, opening the display, and setting the error handlers. It then returns an application shell widget.

The function initialize takes three arguments: the name of the application, the name of the application class, and a list of resources. These are passed to XtOpenDisplay if it is called. The first two are also passed to XtAppCreateShell.

The deleteResponse resource of the application shell widget is always set to DO_NOTHING by initialize.

When running an application from the MLWorks interactive environment, the event dispatch loop in the environment itself will dispatch all events to the application as well. Stand-alone applications must run Xm.mainLoop to start an event dispatch loop of their one. Applications started from the MLWorks interactive environment must not run this function.

Event-handling subloops may be created using the Xm.doInput function. This dispatches a single event. It returns false if the application shell has been destroyed. Otherwise it returns true.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker