motif 使用问题?
哪位能告我一下怎样才能配好motif环境?(详细的)
------解决方案--------------------test.c:
#include <Xm/PushB.h>
main (int argc, char *argv[])
{
Widget toplevel, button;
XtAppContext app;
void button_pushed(Widget, XtPointer, XtPointer);
XmString label;
Arg args[2];
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaOpenApplication (&app, "Hello ", NULL, 0, &argc, argv,
NULL,sessionShellWidgetClass, NULL);
label = XmStringCreateLocalized ( "Push here to say hello ");
XtSetArg(args[0], XmNlabelString, label);
button = XmCreatePushButton (toplevel, "pushme ", args, 1);
XmStringFree (label);
XtAddCallback (button, XmNactivateCallback, button_pushed, NULL);
XtManageChild (button);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
void button_pushed (Widget widget, XtPointer client_data, XtPointer call_data)
{
printf ( "Hello Yourself!\n ");
}
gcc -W -o test test.c -L/usr/X11R6/lib -lXm -lXt -lX11 -I/usr/X11R6/include