Previous Next Up Title Contents Index Top Library

5.4.7.4. DEBUGGING CSS FROM A MOTIF PROGRAM

The typical program is :

Toolkit initialisation XtInitialize ...

Widget creation XtCreateWidget ....

Callback, Event handler XtAdd...

Realize XtRealize...

event loop XtMainLoop ....

1 - If the CSS had been created in the XmNcreateDACallback callback of the GPHIGS widget, simply set the resource :

XmNdebugMode

at

XmGDEBUG_MODE

when creating GPHIGS widget to access the debugger (File and Debug). Then locate the required break points (Functions type by All Functions for example) and finally activate the debugger's Go button to run the application, which will stop at the specified break points. If the Browser On toggle is active, the user will see the CSS constructed progressively as the PHIGS commands are executed.

see MHLSDB.c demonstration program.

2 - If the CSS had been created by a user command (click on the push button, ..) the CSS construction must then be boxed by two calls :

void gphigs_gui_debug (toplevel, wsid, font, context)

Widget toplevel;

int wsid;

char *font;

XtAppContext *context;

toplevel : An application shell (top level).

wsid : Workstation number

font : font used for the debugger (if NULL -> "fixed")

context : Motif context is returned by the function. This context will be used by the gphigs_gui_wait_end_debug function.

void gphigs_gui_wait_end_debug (context)

XtAppContext context;

context : Motif context is returned by the gphigs_gui_debug function.

If the callback that is constructing the CSS is create_CSS :

	void create_CSS(Widget w, XtPointer client, XtPointer call)
	{
	XtAppContext context;

		gphigs_gui_debug (toplevel,wsid,font,&context);

				<- CSS construction

		gphigs_gui_wait_end_debug (context);
	}


Previous Next Up Title Contents Index Top Library