首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

motif 使用有关问题

2012-02-14 
motif使用问题?哪位能告我一下怎样才能配好motif环境?(详细的)[解决办法]test.c:#includeXm/PushB.hmain

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

热点排行