[centos-users 1123] Motifエラーのついて
河野修治
shuji_kohno @ livedoor.com
2009年 4月 10日 (金) 15:38:32 JST
Shujiともうします。
今回はMotifの件で質問します。 おわかりの方がおられたらよろしくお願いします。
次のプログラムを起動するとErrorでおちます
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 19 (X_DeleteProperty)
Resource id in failed request: 0x0
Serial number of failed request: 92
Current serial number in output stream: 96
原因をたどっていくと、おちているのはXmCreateFormだとわかりました。
XtInitializeで生成したtoplevel Widget を親に生成したのですが、
どうもWindow ができていないようです。(printfでみたところ、address値は0)
元々はAIX4.33のプログラムで、こちらでは問題なかったのですが、Linux
ではXtInitializeとは違う関数を使う必要があるのでしょうか?
OS:CentOS Linux4.7 C++:gcc3.4.6(g++)
コンパイル リンク
g++ -I/usr/include/Xm -I/usr/include/X11 -c Program.C
g++ -o Program Program.o -L/lib -L/usr/lib -L /usr/X11R6/lib
-L/usr/local/lib -lXaw -lXmu -lXt -lXm -lX11 -lm -lbsd -lnsl
ソース抜粋
:
//TOPLEVEL
_toplevel = XtInitialize(argv[0],"MAIN",NULL,0,&argc,argv);
printf("_toplevel address=%0x\n",_toplevel); //2009.04.09
//2009.04.10↓
printf("_toplevel Display Address=%0x\n",XtDisplay(_toplevel));
printf("_toplevel Window Address=%0x\n",XtWindow(_toplevel));
//2009.04.10↑
:
cout << "Mainmnu::Mainmnu bef Main Form \n" << flush;
printf("Mainmnu::Mainmnu toplevel address=%0x\n",toplevel); //2009.04.09
// Root Widget
int n = 0;
XtSetArg(args[n],XmNautoUnmanage,False);n++;
XtSetArg(args[n],XmNwidth,600);n++;
XtSetArg(args[n],XmNheight,600);n++;
_w = XmCreateForm(_toplevel, "地域選択", args, n);<--ここ!
XtManageChild(_w);
:
XtRealizeWidget(_toplevel);
:
XtMainLoop();
よろしくお願いします。
centos-users メーリングリストの案内