Next: Widget Creation Up: Basic Motif programming principles Previous: Basic Motif programming principles

Initializing the toolkit

The initailisation of the Xt toolkit must be the first stage in any Motif program.

There are several ways to initialise the toolkit. XtVaAppInitialise() is one way. For most of our programs this is the only one that needs concern us.

When the XtVaAppInitialise() function is called the following tasks are performed:

The Widget data structure top_wid is picked up in push.c.

XtInitialise() has several arguments:

Application context
(address of) - This is a structure that Xt requires for operation. For the Motif programs that we will be considering we do not need to know anything about this and need just to set this in our program.
Application class name
- A string. Again for our applications this will not be used so this just has to be set.

Command line arguments
- The third and fourth arguments specify a list of objects of the special X command line arguments that can be specified to an X program. The third argument is the list, the fourth the number in the list. This is advanced X use and is not considered in this course. Just set the third argument to NULL and the fourth to 0. The fifth and sixth arguments &argc and argc contain the values of any command line argument given. In our case we can just ignore these parameters.
Fallback Resources
- this is a NULL terminated list we will again not be concerned with this so set it to NULL
Additional Parameters - a NULL terminated list. Advanced use only leave set to NULL



Next: Widget Creation Up: Basic Motif programming principles Previous: Basic Motif programming principles


Dave.Marshall@cm.cf.ac.uk
Tue May 24 16:52:56 BST 1994