当前位置: 技术问答>linux和unix
Motif在XWindow执行弹出的错误
来源: 互联网 发布时间:2015-06-08
本文导语: 我编译通过下面Hello.c程序 /* hello.c -- initialize the toolkit using an application context and a * toplevel shell widget, then create a pushbutton that says Hello using * the varargs interface. */ #include mai...
我编译通过下面Hello.c程序
/* hello.c -- initialize the toolkit using an application context and a
* toplevel shell widget, then create a pushbutton that says Hello using
* the varargs interface.
*/
#include
main(argc, argv)
int argc;
char *argv[];
{
Widget toplevel, button;
XtAppContext app;
void button_pushed();
XmString label;
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaAppInitialize (&app, "Hello", NULL, 0,
&argc, argv, NULL, NULL);
label = XmStringCreateLocalized ("Push here to say hello");
button = XtVaCreateManagedWidget ("pushme",
xmPushButtonWidgetClass, toplevel,
XmNlabelString, label,
NULL);
XmStringFree (label);
XtAddCallback (button, XmNactivateCallback, button_pushed, NULL);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
void
button_pushed(widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
{
printf ("Hello Yourself!");
}
通过,可是当运行程序时却弹出错误提示:
X Error of failed request: BadWindow (invalid Window parameter)
major opcode of failed request: 19 (X_DeleteProperty)
Resource id in failed request: 0x0
Serialnumber of failed request: 88
Current serial number in output stream: 93
什么原因?
/* hello.c -- initialize the toolkit using an application context and a
* toplevel shell widget, then create a pushbutton that says Hello using
* the varargs interface.
*/
#include
main(argc, argv)
int argc;
char *argv[];
{
Widget toplevel, button;
XtAppContext app;
void button_pushed();
XmString label;
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaAppInitialize (&app, "Hello", NULL, 0,
&argc, argv, NULL, NULL);
label = XmStringCreateLocalized ("Push here to say hello");
button = XtVaCreateManagedWidget ("pushme",
xmPushButtonWidgetClass, toplevel,
XmNlabelString, label,
NULL);
XmStringFree (label);
XtAddCallback (button, XmNactivateCallback, button_pushed, NULL);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
void
button_pushed(widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
{
printf ("Hello Yourself!");
}
通过,可是当运行程序时却弹出错误提示:
X Error of failed request: BadWindow (invalid Window parameter)
major opcode of failed request: 19 (X_DeleteProperty)
Resource id in failed request: 0x0
Serialnumber of failed request: 88
Current serial number in output stream: 93
什么原因?
|
没什么问题啊。什么系统?