[comp.windows.x] Manipulating Widgets from Motif UID files.

cheewai@spinifex.eecs.unsw.oz (Chee-Wai Yeung) (03/03/91)

I am posting this for my friend. As I have no knowledge of Motif, I'll
try my best.

From a Motif UID file, how can the widget resource be retrieved and/or
changed? Also, how can the widget ID be retrieved?

Thanks in advance.

Chee-Wai Yeung (cheewai@spectrum.cs.unsw.oz.au)

gstiehl@pixel.convex.com (Greg Stiehl) (03/06/91)

cheewai@spinifex.eecs.unsw.oz (Chee-Wai Yeung) writes:

>From a Motif UID file, how can the widget resource be retrieved and/or
>changed? Also, how can the widget ID be retrieved?

The cleanest way is to use the MrmNcreateCallback callback.  The function
that you register can store the widget ID passed to it. Then you can use
this ID to do XtSetValues and XtGetValues().

Here is an example:

UIL:
    object transDialog: XmFormDialog {
	callbacks {
	    MrmNcreateCallback = procedure transCreate();
	};
    };


C:
    static Widget transWidget = NULL;

    void transCreate(w, client, call)

	Widget              w;
	XtPointer           *client;
	XtPointer           *call;

    {
	transWidget = w;
    }