next up previous contents
Next: Loading External Resource Up: Writing An X Previous: Naming Conventions

Program Structure

Programs written using the X Toolkit typically have the following structure:

Header files
to include the declarations and definitions for the Xt intrinsics and widget set.
Initialize the Xt intrinsics
handles connection to a display, sets the application's class name and deals with command line options.
Create the application's main widgets
specifying their class, parent widget, etc. and configure their resources.
Register callbacks
for those widgets that are to interact with the application programmer's code.
Realize widgets
causing the widgets to set window attributes and windows to be drawn on to the screen.
Enter the event loop
passing control of the application to Xt.
Callback routines
(the application programmer's code) are usually defined afterwards.



JR Pitchers
Wed May 3 16:45:04 BST 1995