$B;d2HHG(BMotif FAQ

$B$3$l$^$G$K!"e$GKM$,Ez$($F$-$?!"(BMotif$B$d(BXt$B$K4X$9$kF$/$J$j$*9%$-$J$h$&$K$7$F$/$@$5$$!#(BMotif$B$N%P!<%8%g%s$O $B%5%s%W%k%W%m%0%i%`$O!"0J2<$N>r7o$GF0:n3NG'$7$F$$$^$9!#(B
  • OS$B!'(BSunOS 4.1.4
  • $B%3%s%Q%$%i!'(Bgcc version 2.7.2.2
  • X$B%5!<%P!'(BX11R6.3$B$N(BXsun
  • Xlib&Xt$B!'(BX11R5 with Xsi
  • Motif$B!'(BOSF$B$+$i9XF~$7$?(Bversion 1.2.3

$B$3$N(BFAQ$B$=$N$b$N$K4X$9$kLd$$9g$o$;$O;d08$N%a!<%k$G$b$+$^$$$^$;$s$,!"(B $B?7$?$Jfj.comp.x11$B$K=P$7$F$/$@$5$$!#(B $B


$B
  • $BI=<((B
    • $B%3!<%k%P%C%/4X?t$NCf$G!"(BXmNlabelString$B$r7+$jJV$7JQ99$7$F$b!"(B $B:G8e$NJQ99$7$+I=<($KH?1G$5$l$J$$(B $B"*(B
    • $B;~4V$N$+$+$k=hM}$NA0$K!"B~:#:n6HCf$N%@%$%"%m%0$rI=<($7$?$$$N$@(B $B$,!"I=<($5$l$J$$$+!"$N$C$Z$i$\!<$J%&%#%s%I%&$7$+I=<($5$l$J$$(B $B"*(B
    • $B&A!"&HEy$N%.%j%7%cJ8;z$r(B -adobe-symbol-medium-r-normal--24-*-adobe-fontspecific $B$N%U%)%s%H$r;H$C$FI=<($7$?$$(B $B"*(B
    • $BJ#9gJ8;zNs$r@8@.!":o=|$7$J$$$G!"(BLabel$B%&%#%8%'%C%H$KI=<($9$kJ8;zNs$rJQ(B $B99$7$?$$(B $B"*(B
  • $BF|K\8l$NI=<((B
    • $BJd=u4A;z$rI=<($9$k$3$H$,$G$-$J$$(B $B"*(B
    • $BF|K\8l$N%m%1!<%k$r@_Dj$7$?$H$-$K!"(BText$B%&%#%8%'%C%H$N2#I}$H%?%V$NI}(B $B$,FsG\$K$J$C$F$7$^$&(B $B"*(B
  • $B?'(B
    • $B%&%#%8%'%C%H$N?'$r7+$jJV$7JQ99$9$k$H!"$d$,$F(B Xlib: resource ID allocation space exhausted! $B$H$$$&%(%i!<$G;_$^$C$F$7$^$&(B $B"*(B
    • $B%G%U%)%k%H$H0[$J$k%S%8%e%"%k$G%&%#%8%'%C%H$r:n@.$7$?$$(B [98/3/25$B99?7(B] $B"*(B
    • Xt-FAQ$B$K=,$C$F!"5/(B $BF0%*%W%7%g%s$d%j%=!<%9%U%!%$%k$G%S%8%e%"%k$r;XDj$7$?$$$N$@$,$&(B $B$^$/$$$+$J$$(B [98/3/25$BDI2C(B] $B"*(B
    • XmNcolormap$B$K%G%U%)%k%H$H0[$J$k(Bcolormap$B$r@_Dj$7$?$N$KI=<($KH?(B $B1G$5$l$J$$(B [98/3/25$B99?7(B] $B"*(B
    • DrawingArea$B$K%G%U%)%k%H$H0[$J$k%+%i!<%^%C%W$r@_Dj$9$k$H!"B>$N(B $B%&%#%8%'%C%H$N?'$b68$C$FA`:n$7$E$i$$(B [98/3/25$BDI2C(B] $B"*(B
  • $BF~NO(B
    • $BJ#?t$N(BTextField$B$rJB$Y$F!"0l$D$N(BTextField$B$NF~NO$,=*$o$C$?;~E@$G!"(B $B$B"*(B
    • Motif$B$N%"%W%j%1!<%7%g%s$rN)$A>e$2$?C$B"*(B
    • $BB>$N%"%W%j%1!<%7%g%s$G%^%&%9$GA*Br$7$?NN0h$N>pJs$r!"(BMotif$B$N%W%m%0%i(B $B%`$G07$$$?$$(B $B"*(B
    • Text(Field)$B%&%#%8%'%C%H$KF~NO$5$l$?J8;zNs$N0lIt(B($B$"$k$$$OA4BN(B) $B$rH?E>I=<($7$?$$(B $B"*(B
  • $B%$%Y%s%H=hM}(B
    • PushButton$B$,2!$5$l$?$H$-$K%3!<%k%P%C%/4X?t$r$B"*(B
    • $B%W%k%@%&%s%a%K%e!<0J30$KG[CV$5$l$?%W%C%7%e%\%?%s$K%"%/%;%i%l!<%?$r(B $B@_Dj$7$?$$(B $B"*(B
    • fork$B$7$?;R%W%m%;%9$+$i!"(BClientMessage Event$B$r(BXSendEvent() $B$GAw?.$7$F!":n6H$N=$N;$r?F%W%m%;%9$KDLCN$7$?$$(B $B"*(B
    • $BFCDj$N%3!<%k%P%C%/4X?t$,8F$P$l$?;~E@$G!"<+A0$N%$%Y%s%H%k!<%W(B $B$r=*N;$5$;$?$$$N$@$,!"$9$0$K=*N;$7$F$/$l$J$$(B $B"*(B
    • UNIX$B$N%7%0%J%k$KBP1~$7$?=hM}$r5-=R$7$?$$(B $B"*(B
  • $BG[CV4IM}(B
    • $B%f!<%6$K$h$k%&%#%s%I%&$N%j%5%$%:$r6X;_$7$?$$(B $B"*(B
    • mwm$B0J30$N%&%#%s%I%&%^%M!<%8%c$G$b%&%#%s%I%&$N%j%5%$%:$r6X;_$7$?$$(B [98/4/23$BDI2C(B]$B"*(B
    • $B%@%$%"%m%0%\%C%/%9$NI=<($5$l$k0LCV$r%W%m%0%i%`$+$i%3%s%H%m!<%k(B $B$7$?$$(B $B"*(B
    • $BFCDj$N%@%$%"%m%0%\%C%/%9$r>o$K[98/4/23$BDI2C(B]$B"*(B
  • $B$=$NB>(B
    • Motif$B$N%P!<%8%g%sHV9f$rD4$Y$?$$(B $B"*(B

$BI=<((B


$B
$B%3!<%k%P%C%/4X?t$NCf$G!"(BXmNlabelString$B$r7+$jJV$7JQ99$7$F$b!"(B $B:G8e$NJQ99$7$+I=<($KH?1G$5$l$J$$!#(B
$B2sEz!'(B
Xt(Va)SetValue()$B$GI=<($K4X$9$k%j%=!<%9CM$rJQ99$9$k$H!"JQ99(B $B$7$?%&%#%8%'%C%H$KBP$7$F(BExpose$B%$%Y%s%H$,@8@.$5$l!"$=$N(BExpose$B%$%Y%s(B $B%H$,%$%Y%s%H%k!<%W$G=hM}$5$l$?$H$-$K!"=i$a$FI=<($,99?7$5$l$k!#(B

$B$7$?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$rJV$5$:$K!";~4V$N$+$+$k=hM}$r $B$@$+$i$H$$$C$F!"(BXmUpdateDisplay()$B$r;H$C$F$b!"$N$C$Z$i$\!<(B $B$J%&%#%s%I%&$,I=<($5$l$k$@$1$G$"$k!#%&%#%s%I%&$NI=<($K%&%#%s%I%&%^(B $B%M!<%8%c$,2pF~$9$k4X78$G!"(BXmUpdateDisplay()$B$,(BExpose$B%$%Y%s(B $B%H$rBT$?$:$K=*N;$7$F$7$^$&$+$i$@!#(B

XmUpdateDisplay()$B$NBe$o$j$K!"0J2<$K<($9(B WaitExposeEvent()$B$r(BXtManageChild()$B$ND>8e$K8F$S=P(B $B$9$H!"@5$7$/I=<($5$l$k$h$&$K$J$k!#(B

void
WaitExposeEvent(Widget target)
{
    /* $B%&%#%8%'%C%H$N%&%#%s%I%&$N(BID$B$r
     $B%W%m%0%i%`A4BN(B

$B
$B&A!"&HEy$N%.%j%7%cJ8;z$r(B -adobe-symbol-medium-r-normal--24-*-adobe-fontspecific $B$N%U%)%s%H$r;H$C$FI=<($7$?$$!#(B
$B2sEz!'(B
$B%U%)%s%H%j%9%H$r;H$C$F!"E,Ev$J%?%0$H$3$N%U%)%s%H$rBP1~IU$1$F$*$$$F!"(B $BJ#9gJ8;zNs$r:n@.$9$k$H$-$K$=$N%?%0$r;XDj$9$l$P$h$$!#6qBNE*$J Widget top, label; XmString xms; String fontlist = "-adobe-symbol-medium-r-normal--24-*-adobe-fontspecific=ADOBESYMBOL"; ... xms = XmStringCreate("abcdefg", "ADOBESYMBOL"); XtVaSetValues(label, XmNlabelString, xms, /* $B%U%)%s%H%j%9%H$N@_Dj(B */ XtVaTypedArg, XmNfontList, XtRString, fontlist, strlen(fontlist)+1, NULL); XmStringFree(xms); $B%W%m%0%i%`A4BN(B

$B%W%m%0%i%`$N $B&A&B&V&D&E&U&C(B

$B%U%)%s%H%j%9%H$N@_Dj$KMQ$$$F$$$k(BXtVaTypedArg$B$K$D$$$F$O!"(B X$B%D!<%k%-%C%H!&%$%s%H%j%s%7%/%9!&%W%m%0%i%_%s%0!&%^%K%e%"%k(B $B$N(B3.7.1$B@a$r;2>H$7$F$[$7$$!#(B $B%j%=!<%9%U%!%$%k$K5-=R$,J,$+$l$k$N$r7y$C$F(BXtVaTypedArg$B$rMQ(B $B$$$?$,!"IaDL$O%j%=!<%9%U%!%$%k$G;XDj$9$l$P$h$$!#Nc$($P(B

Sample*label.fontList: \
    -adobe-symbol-medium-r-normal--24-*-adobe-fontspecific=ADOBESYMBOL

$B
$BJ#9gJ8;zNs$r@8@.!":o=|$7$J$$$G!"(BLabel$B%&%#%8%'%C%H$KI=<($9$kJ8;zNs$rJQ(B $B99$7$?$$!#(B
$B2sEz!'(B
$BI=<($9$kJ8;zNs$ND9$5$,F1$8$G!"%U%)%s%H%?%0$bJQ99$7$J$$$N$G$"$l$P!"(B $BHf3SE*4JC1$KJQ99$G$-$k!#%W%i%$%Y!<%H%X%C%@%U%!%$%k$rMxMQ$7$F!"(BLabel $B%&%#%8%'%C%H$NFbIt9=B$$K?($j!"J8;zNs$,3JG<$5$l$F$$$kNN0h$rD>@\=q$-(B $B49$($l$P$h$$!#6qBNE*$J /* $B%W%i%$%Y!<%H%X%C%@%U%!%$%k$r%$%s%/%k!<%I$9$k(B */ #include <Xm/LabelP.h> ... String label_string_ptr; /* $BD>@\=q$-49$($k0LCV$rJ];}$9$k(B */ ... String str = "000000"; Arg label_arg[1]; ... xms = XmStringCreateSimple(str); XtSetArg(label_arg[0], XmNlabelString, xms); label = XmCreateLabel(top, "label1", label_arg, XtNumber(label_arg)); XmStringFree(xms); ... /* $B%i%Y%k%&%#%8%'%C%H$NCf?H$K?($C$F(B $BJ8;zNs>pJs$rpJs$NCf?H$r=q$-49$($k(B */ sprintf(label_string_ptr, "%06d", count); /* Expose Event$B$rAw$C$FI=<($r99?7$9$k(B */ XClearArea(XtDisplay(label), XtWindow(label), 0, 0, 0, 0, True); $B%W%m%0%i%`A4BN(B

$B=EMW$J$N$O!"J8;zNs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6!$5$l$F$$$k!#(B


$B
$BF|K\8l$N%m%1!<%k$r@_Dj$7$?$H$-$K!"(BText$B%&%#%8%'%C%H$N2#I}$H%?%V$NI}(B $B$,FsG\$K$J$C$F$7$^$&!#(B
$B2sEz!'(B
$B$3$N8=>]$O!"(BText$B%&%#%8%'%C%H$,0lJ8;z$N2#I}$H$7$F!"$b$C$H$b2#I}$N9-(B $B$$%U%)%s%H!"$D$^$j4A;z%U%)%s%H$N2#I}$rMQ$$$F$$$k$?$a$K5/$3$k!#2#I}(B $B$O%j%=!<%9(BXmNcolumns$B$NCM$rH>J,$K@_Dj$7D>$;$P$h$$$,!"%?%V$N(B $BI}$O%j%=!<%9$G$OJQ99$G$-$J$$$N$G:$$C$F$7$^$&!#(B

$B%?%V$NI=<(I}$rJQ99$9$k$K$O!"%W%i%$%Y!<%H%X%C%@%U%!%$%k$rMxMQ$7$F!"(B Text$B%&%#%8%'%C%H$NFbIt9=B$$K?($kI,MW$,$"$k!#%?%V$N2#I}$O!"%W%i%$%Y!<(B $B%H%X%C%@%U%!%$%k(BTextOutP.h$B$GDj5A$5$l$F$$$k!"9=B$BN(B OutputDataRec$B$K4^$^$l$F$$$k!#(B

$B0J2<$NOutputDataRec$B$N%]%$%s%?$r #include <Xm/Text.h> #include <Xm/TextP.h> ... Widget text; OutputData data; /* OutputDataRec * */ ... data = ((XmTextRec *)text)->text.output->data; $B$5$i$K!"$3$N%]%$%s%?$rMxMQ$7$F(B

  data->tabwidth /= 2;
$B$H$9$k$H!"%?%V$N2#I}$,H>J,$K$J$k!#(B

$B$H$3$m$G!"$3$N!VF|K\8l$N%m%1!<%k$N$H$-$KH>J,$K$9$k!WJ}K!$O!"(B

  • $BF|K\8l$N%m%1!<%k$+D4$Y$k$N$,$a$s$I$/$5$$(B
  • Motif$B$NJ,$K$9$kI,MW$,$J$$$3$H$b$"$k(B
  • $B4A;z%U%)%s%H$,(BASCII$B%U%)%s%H$NFsG\$NI}$r;}$D$H$-$K$7$+DLMQ$7$J$$(B
$B$H$$$&E@$G!"NI$$J}K!$H$O8@$($J$$!#(B $B;d$N$*4+$a$O!" void ResetWidth(Widget text) { XmFontList fontlist; short cols; OutputData data; int width; static XmString xms = NULL; if (!xms) xms = XmStringCreate("0", XmFONTLIST_DEFAULT_TAG); XtVaGetValues(text, XmNfontList, &fontlist, NULL); width = XmStringWidth(fontlist, xms); printf("%d\n", width); data = ((XmTextRec *)text)->text.output->data; cols = data->columns; data->averagecharwidth = width; data->tabwidth = width * 8; XtVaSetValues(text, XmNwidth, width * cols + data->leftmargin + data->rightmargin, NULL); }
$B%W%m%0%i%`A4BN(B

$B$3$NJ}K!$b8GDjI}%U%)%s%H$G$7$+DLMQ$7$J$$$,!"$3$l0J>e2?$+$7$h$&$H$9(B $B$k$H!"$H$F$b$a$s$I$/$5$$$N$G!"$3$NJU$GBE6($7$?$$!#(B


$B?'(B


$B
$B%&%#%8%'%C%H$N?'$r7+$jJV$7JQ99$9$k$H!"$d$,$F(B Xlib: resource ID allocation space exhausted! $B$H$$$&%(%i!<$G;_$^$C$F$7$^$&!#(B
$B2sEz!'(B
$B;DG0$J$,$iH4K\E*$J2r7h:v$O$J$$$N$G!"?'$r7+$jJV$7JQ99$9$k$N$r;_$a$k(B $B$7$+$J$$!#(B

$B%&%#%8%'%C%H$N?'$rJQ99$9$k$H!"A0$N?'$GIA2h$9$k$?$a$N%0%i%U%#%C%/%3(B $B%s%F%-%9%H$,:o=|$5$l!"?7$?$J?'$GIA2h$9$k$?$a$N%0%i%U%#%C%/%3%s%F%-(B $B%9%H$,@8@.$5$l$k!#$H$3$m$,!"%0%i%U%#%C%/%3%s%F%-%9%H$O0lDj2s?t$7$+(B $B@8@.$G$-$J$$$?$a!"$=$N2s?t$KC#$7$?;~E@$G%(%i!<$K$J$C$F$7$^$&!#(B

$B%0%i%U%#%C%/%3%s%F%-%9%H$@$1$G$J$/!"%&%#%s%I%&$d%+%i!<%^%C%W$J$I!"(B $B0l0U$J<1JL;R$rI,MW$H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ationShell$B$G$O!"0J2<$N$h$&$K@8@.8e$+$iA0$^$G$K(B3$BE@%;%C%H$r@_Dj$9$l$P$h$$!#(BDialogShell$B$N>l9g(B $B$K$O!"(BXmCreate...Dialog()$B$N0z?t$G@_Dj$9$k$N$,$$$$$@$m$&!#(B

    top = XtAppInitialize(&app, "Sample", NULL, 0, &ac, av, NULL, NULL, 0);
    if (!XMatchVisualInfo(XtDisplay(top), XtScreen(top), 24,
			  TrueColor, &vinfo)) {
	XtAppError(app, "Cannnot find Visual of 24bits TrueColor.");
	exit(1);
    }
    cmap = XCreateColormap(XtDisplay(top), RootWindowOfScreen(XtScreen(top)),
			   vinfo.visual, AllocNone);
    XtVaSetValues(top,
		  XmNdepth, vinfo.depth,
		  XmNvisual, vinfo.visual,
		  XmNcolormap, cmap,
		  NULL);

$B
Xt-FAQ$B$K=,$C$F!"(B $B5/F0%*%W%7%g%s$d%j%=!<%9%U%!%$%k$G%S%8%e%"%k$r;XDj$7$?$$$N$@$,$&$^$/$$(B $B$+$J$$(B
$B2sEz!'(B
Motif$B$G$O!"5/F0%*%W%7%g%s$d%j%=!<%9%U%!%$%k$G(Bdepth$B$H(B visual$B$r;XDj$9$k7A$G!"(BShell$B%&%#%8%'%C%H$N%S%8%e%"%k$r;XDj(B $B$9$k$3$H$O$G$-$J$$!#(B

Xt-FAQ$B$G$O!"(BShell$B%&%#(B $B%8%'%C%H$, $B$3$l$r2sHr$9$k$K$O!"(B.depth:$B$H(B.visual:$B$r$"$-$i$a$F!"(B $B%"%W%j%1!<%7%g%sFH<+$N%j%=!<%9$rMQ$$$k$7$+$J$$!#(B $B$3$N(B$B%5%s%W%k%W%m%0%i%`(B$B$G$O!"(B depth$B!"(Bvisual$B$NBe$o$j$K(BvisualDepth$B!"(B visualClass$B$rMQ$$$F$*$j!"%j%=!<%9%U%!%$%k$G$O(B

    Sample.visualDepth: 24
    Sample.visualClass: TrueColor
$B$N$h$&$K!"5/F0;~$K$O(Bownvisual -depth 24 -visual TrueCol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
    wlist[1] = XtParent(dialogBox);
    XtSetWMColormapWindows(wlist[1], wlist, 2);
$B$3$N4X?t$rl9g$K$O(B XtRealizeWidget()$B$N8e$G$h$$!#(BDialogShell$B$,XtManageChild()$B$7$?$H$-$J$N$G(B
  • XtManageChild()$B$ND>8e(B
  • DialogShell$B>e$N%&%#%8%'%C%H$NE,@Z$J%3!<%k%P%C%/4X?t(B
  • $B@h$K(BXtRealizeWidget()$B$r8e(B
$B$N$$$:$l$+$G
$B
DrawingArea$B$K%G%U%)%k%H$H0[$J$k%+%i!<%^%C%W$r@_Dj$9$k$H!"B>$N%&%#(B $B%8%'%C%H$N?'$b68$C$FA`:n$7$E$i$$(B
$B2sEz!'(B
$B%G%#%9%W%l%$%G%P%$%9$K@_Dj$G$-$k%+%i!<%^%C%W$,(B1$B8D$7$+$J$$>l9g$K!"$3(B $B$N8=>]$,5/$3$k!#(B

$B$3$l$r2sHr$9$k$K$O!"%+%i!<%^%C%W$r(BDrawingArea$B$G$O$J$/!"(BDrawingArea $B$,G[CV$5$l$F$$$k(BShell$B$K@_Dj$7$F!"(BShell$B>e$N%&%#%8%'%C%H$G%+%i!<%^%C(B $B%W$r6&M-$5$;$l$P$h$$!#%&%#%8%'%C%H$,;H$&?'?tJ,;H$($k%+%i!<%;%k$,8:$C(B $B$F$7$^$&$,!"%&%#%8%'%C%H$N?'$,68$&$N$OKI$2$k!#(B

$B%&%#%8%'%C%H$NA`:n$rK8$2$J$$$h$&$K$9$k$?$a$K!"(BDrawingArea$B$K%^%&%9%](B $B%$%s%?$,$"$k$H$-$@$1!"(BDrawingArea$B$N%+%i!<%^%C%W$rM%@h$5$;$kJ}K!$b$"(B $B$k!#0J2<$O!"$=$N(B$B%5%s%W%k%W%m%0%i%`(B$B$N0lIt(B

    /* $B%]%$%s%?F~=P<+$NF0:n$r5-=R(B */
    char *action_table = "<Enter>: SetCm(0)\n <Leave>: SetCm(1)\n";
    /* $B%"%/%7%g%s$H4X?t$r7k$SIU$1$k(B */
    void SetCM(Widget w, XEvent *ev, String *args, Cardinal *num);
    static XtActionsRec actions[] =
    {
    { "SetCm", SetCM },
    };
...
    /* $B%"%/%7%g%s$NEPO?(B */
    XtAppAddActions(app, actions, XtNumber(actions));
    /* $BF0:n$r(BDrawingArea$B$K;E9~$`(B */
    XtOverrideTranslations(draw_area, XtParseTranslationTable(action_table));
...
void
SetCM(Widget w, XEvent *ev, String *args, Cardinal *num)
{
    Widget wlist[2];

    if (args[0][0] == '0') {
	/* DrawingArea$B$N%+%i!<%^%C%W$rM%@h(B */
	wlist[0] = w;
	wlist[1] = shell;
    } else {
	/* $B%G%U%)%k%H$N%+%i!<%^%C%W$rM%@h(B */
	wlist[0] = shell;
	wlist[1] = w;
    }
    XtSetWMColormapWindows(shell, wlist, 2);
}
$B%&%#%s%I%&%^%M!<%8%c$NCf$K$O!"2?$b$7$J$/$F$b$3$N%W%m%0%i%`$HF1$8F0(B $B:n$r$9$k$b$N$b$"$k!#$^$?!"(BSGI$Bl9g$G$b!"$3$N%3!<%I$O(B $BJQ$J

$BF~NO(B


$B
$BJ#?t$N(BTextField$B$rJB$Y$?$H$-$K!"0l$D$N(BTextField$B$NF~NO$,=*$o$C$?;~E@$G!"(B $B$B2sEz!'(B
TextField$B$N(BXmNactivateCallback$B$KEPO?$7$?%3!<%k%P%C%/4X?t$G!"(B XmProcessTraversal()$B$r8F$S=P$;$P$h$$!#F~NOFbMF$r%A%'%C%/$;(B $B$:$K%U%)!<%+%9$r0\$7$F9=$o$J$$$H$-$K$O!"(B XmProcessTraversal()$B<+?H$r%3!<%k%P%C%/4X?t$H$7$FEPO?$7$F$b(B $B$h$$!#(B

XmProcessTraversal()$B$G;XDj$9$k0z?t$O!"(B XmTRAVERSE_NEXT$B$G$O$J$/(BXmTRAVERSE_NEXT_TAB_GROUP$B$G(B $B$"$k!#$3$l$O!"(BTextField$B$,$=$l<+?H$G%?%V%0%k!<%W$r9=@.$9$k$+$i$G$"$k!#(B

$B6qBNNc$r0J2<$K<($9!#(B

    rc = XmCreateRowColumn(top, "rc", NULL, 0);
    XtManageChild(rc);
    text[0] = XmCreateTextField(rc, "text1", NULL, 0);
    text[1] = XmCreateTextField(rc, "text2", NULL, 0);
    text[2] = XmCreateTextField(rc, "text3", NULL, 0);
    XtManageChildren(text, 3);

    for (i = 0; i < 3; i++)
        XtAddCallback(text[i], XmNactivateCallback,
                      (XtCallbackProc)XmProcessTraversal,
                      (XtPointer)XmTRAVERSE_NEXT_TAB_GROUP);
$B%W%m%0%i%`A4BN(B

Motif 1.0$B$N:"$O(BXmProcessTraversal()$B$H$$$&4X?t$,B8:_$7$J$+$C$?$?(B $B$a!"%"%/%7%g%s4X?t(Bnext-tab-group()$B$rMxMQ$9$kI,MW$,$"$C$?!#$^$?!"(B $B%?%V%0%k!<%W$,<+F0E*$K9=@.$5$l$J$+$C$?$N$G!"(BXmAddTabGroup()$B$rMQ(B $B$$$FL@<(E*$K9=@.$9$kI,MW$,$"$C$?!#8=:_$G$O$I$A$i$bITMW$G$"$k!#(B


$B
Motif$B$N%"%W%j%1!<%7%g%s$rN)$A>e$2$?C $B2sEz!'(B
XtAppAddInputs()$B$GI8=`F~NO$KBP$9$k%3!<%k%P%C%/4X?t$rEPO?$7(B $B$F!"%3!<%k%P%C%/4X?t$,8F$S=P$5$l$?$H$-$K!"I8=`F~NO$+$iF~NO$rFI$_9~(B $B$s$G=hM}$9$l$P$h$$!#(B

$B$3$N(B$B%5%s%W%k%W%m%0%i%`(B$B$O!"I8=`F~NO$NFbMF(B $B$rFI$_9~$s$G!"(BLabel$B%&%#%8%'%C%H$KI=<($9$k!#(B


$B
$BB>$N%"%W%j%1!<%7%g%s$G%^%&%9$GA*Br$7$?NN0h$N>pJs$r!"(BMotif$B$N%W%m%0%i(B $B%`$G07$$$?$$(B
$B2sEz!'(B
X$B$N%"%W%j%1!<%7%g%s$GIaDL$K%^%&%9$GA*Br$7$?NN0h$O!"(BPrimary$B%;%l%/%7%g(B $B%s$H8F$P$l$k$b$N$G!"(BMotif$B$N%/%j%C%W%\!<%I$H$O0c$&$N$GCm0U$,I,MW$G$"$k!#(B

Primary$B%;%l%/%7%g%s$NCM$O!"(BXtGetSelectionValue()$B$H$$$&4X?t(B $B$G $B0J2<$K<($7$?$N$O!"%W%C%7%e%\%?%s$,2!$5$l$?$H$-$K!"(BPrimary$B%;%l%/%7%g(B $B%s$NFbMF$r(BLabel$B%&%#%8%'%C%H$KI=<($9$k(B $B%W%m%0%i%`(B$B$N0lIt$G$"$k!#(B

#include <Xm/AtomMgr.h> /* XmInternAtom() */

typedef struct {
    Boolean is_text;
    Time time;
} SelectionInfo;

/* $BCM$,F@$i$l$?$H$-$K8F$S=P$5$l$k%3!<%k%P%C%/4X?t(B */
void get_selectionCB(Widget w, SelectionInfo *p,
                       Atom *selection, Atom *type,
                       XtPointer value, unsigned long *n, int *form);

void
pasteCB(Widget w, XtPointer *p, XmPushButtonCallbackStruct *s)
{
    Atom text = XmInternAtom(XtDisplay(w), "TEXT", False);
    static SelectionInfo info;

    /* Primary$B%;%l%/%7%g%s$N(Bowner$B$KJQ49MW5a$r=P$7!"(B
       $BJQ497k2L$r
     Primary$B%;%l%/%7%g%s$N>l9g$OCM$N7?$H$7$F(BTEXT$B7?$r;XDj$9$k!#(BTEXT$B7?$r;X(B
     $BDj$9$k$H!"(BPrimary$B%;%l%/%7%g%s$r;}$D%"%W%j%1!<%7%g%s$,!"(BLattin-1$BJ8;z(B
     $BNs$rI=8=$G$-$k(BSTRING$B7?$+!"B?8@8lJ8;zNs$rI=8=$G$-$k(B
     COMPOUND_TEXT$B7?$G!"$=$NFbMF$rJV$7$F$/$l$k!#MW5a$NH/@8;~9o(B
     $B$K$O!"(BICCCM$B$K=>$C$F!"%$%Y%s%H9=B$BN$K3JG<$5$l$F$$$k;~9o0u$r;XDj$9$k!#(B

$B0J2<$K!"(Bget_selectionCB()$B$NDj5A$r<($9!#(B

void
get_selectionCB(Widget w, SelectionInfo *info,
                Atom *selection, Atom *type,
                XtPointer value, unsigned long *n, int *form)
{
    Atom ctext = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False);
    String str;
    XmString xms;
    char **items = NULL;
    int nitems;

    if (*type == 0 /* $BJQ49$K<:GT(B */|| *n == 0 /* $B%G!<%?$,$J$$(B */) {
        if (info->is_text) {
            info->is_text = False;
            /* $BJ8;zNs7?$r;XDj$7$F$d$jD>$7(B */
            XtGetSelectionValue(w,
                    XA_PRIMARY,
                    XA_STRING,
                    (XtSelectionCallbackProc)get_selectionCB,
                    info,
                    info->time);
            return;
        }
        /* $B%;%l%/%7%g%s$,;XDj$5$l$F$$$J$$(B */
        str = "Empty";
...
$BFbMF$Nl9g$H!"(BPrimary$B%;%l%/%7%g%s$r;}$C$F$$$k%"%W(B $B%j%1!<%7%g%s$,(BTEXT$B7?$rCN$i$J$$>l9g$G$"$k!#8E$$%"%W%j%1!<%7%g%s$O(B TEXT$B7?$rCN$i$J$$$3$H$,$"$k$N$G!"$=$N>l9g$K$O!"(BSTRING$B7?$r;X(B $BDj$7$F$d$jD>$5$J$1$l$P$J$i$J$$!#(B
...
    } else if (*type == ctext) {
        XTextProperty prop = {value, ctext, 8, strlen(value)};

        /* $B%^%k%A%P%$%HJ8;zNs$KJQ49(B */
        if (XmbTextPropertyToTextList(XtDisplay(w),
                                      &prop, &items, &nitems) != Success)
            /* $B2x$7$$(BCOMPUND_TEXT$B$@$C$?(B */
            str = "Error";
        else
            str = items[0];
    } else {
        /* *type == XA_STRING */
        str = value;
    }
    xms = XmStringCreateLtoR(str, XmFONTLIST_DEFAULT_TAG);
    if (value) XFree(value);
    if (items) XFreeStringList(items);
...
$BF@$i$l$?7k2L$,!"(BCOMPOUND_TEXT$B7?$@$C$?>l9g$K$O!"J#9gJ8;zNs(B $B$KJQ49$9$k$?$a$K!"$$$C$?$s%^%k%A%P%$%HJ8;zNs$KJQ49$9$kI,MW$,$"$k!#(B Motif 1.2$B$K$O!"(BCOMPOUND_TEXT$B$rJ#9gJ8;zNs$KD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$5$l$?$H$-$K%3!<%k%P%C%/4X?t$r $B2sEz!'(B
$B$=$N%3!<%k%P%C%/4X?t$r(BXmNactivateCallback$B$G$O$J$/!"(B XmNarmCallback$B$KEPO?$9$l$P$h$$!#(B

$B%5%s%W%k%W%m%0%i%`(B

$B$3$N$h$&$K$9$k$H!"%9%?%$%k%,%$%IE*$K8m$C$??6Iq$$$K$J$k$3$H$KCm0U$;(B $B$h!#%9%?%$%k%,%$%I$O!"%W%C%7%e%\%?%s$K4XO"$E$1$i$l$?F0:n$,9T$o$l$k(B $B$N$O!"(BActivate$B$5$l$?$H$-$G$"$j!"(BActivate$B$H$O%^%&%9$r%W%C%7%e%\%?%s(B $B$NNN0hFb$G2!$7$F!"$=$N$^$^N%$9$3$H$HDj$a$F$$$k!#(B


$B
$B%W%k%@%&%s%a%K%e!<0J30$KG[CV$5$l$?%W%C%7%e%\%?%s$K%"%/%;%i%l!<%?$r(B $B@_Dj$7$?$$(B
$B2sEz!'(B
$B%"%/%;%i%l!<%?$O%W%C%7%e%\%?%s<+?H$N5!G=$G$O$J$/!"%a%K%e!<$r9=@.$9(B $B$k?F%&%#%8%'%C%H$K$h$C$F $B%W%C%7%e%\%?%s$@$1$G$O$B%5%s%W%k%W%m%0%i(B $B%`(B$B$G$O!"(BF1$B%-!<$r2!$9$H(BButton1$B$,!"(BF2$B%-!<$r2!$9$H(BButton2$B$,2!$5$l(B $B$k!#(B

$B
fork$B$7$?;R%W%m%;%9$+$i!"(BClientMessage Event$B$r(BXSendEvent() $B$GAw?.$7$F!":n6H$N=$N;$r?F%W%m%;%9$KDLCN$7$?$$!#(B
$B2sEz!'(B
$B;R%W%m%;%9$G(BXSendEvent()$B$r $B@\B3$rD%$jD>$7$F!"%a%C%;!<%8$rAw?.$9$k Widget w; /* $B?F%W%m%;%9$+$i0z$-7Q$$$@CM(B */ XClientMessageEvent ev; Display *dpy; ... /* $B%5!<%P$H$N@\B3$rD%$jD>$9(B */ dpy = XtDisplay(w); close(ConnectionNumber(dpy)); dpy = XOpenDisplay(DisplayString(dpy)); ... /* $B%a%C%;!<%8$NAw?.(B */ ev.display = dpy; ev.window = XtWindow(w); ev.type = ClientMessage; ev.message_type = XInternAtom(dpy, "_MY_PROTOCOLS", False); ev.format = 32; XSendEvent(dpy, ev.window, False, NoEventMask, (XEvent *)&ev); $B%W%m%0%i%`A4BN(B

$B
$BFCDj$N%3!<%k%P%C%/4X?t$,8F$P$l$?;~E@$G!"<+A0$N%$%Y%s%H%k!<%W(B $B$r=*N;$5$;$?$$$N$@$,!"$9$0$K=*N;$7$F$/$l$J$$!#(B
$B2sEz!'(B
$B0J2<$N$h$&$K!"(BXtAppNextEvent()$B$H(BXtDispatchEvent() $B$G%$%Y%s%H%k!<%W$r9=@.$9$k$H!"(BXtAppAddTimeOut$B$d(B XtAppAddInput$B$GEPO?$7$?%3!<%k%P%C%/4X?t$GBg0hJQ?t(B done$B$NCM$r(BTrue$B$K$7$F$b!" done = False; while (!done) { XtAppNextEvent(app, &ev); XtDispatchEvent(app, &ev); } $B$3$l$i$N%3!<%k%P%C%/4X?t$O(BXtDispatchEvent()$B$G$O$J$/!"(B XtAppNextEvent()$B$NCf$G $B$3$l$rHr$1$k$K$O!"(BXtAppProcessEvent()$B$rMxMQ$7$F%$%Y%s%H%k!<(B $B%W$r9=@.$9$l$P$h$$!#(B
    done = False;
    while (!done)
        XtAppProcessEvent(app, XtIMAll)
XtAppProcessEvent()$B$O!"(BX$B$N%$%Y%s%H!"(BInput$B%$%Y%s%H!"(BTimeOut $B%$%Y%s%H$N$$$:$l$+0l$D$r=hM}$7$F=*N;$9$k4X?t$G$"$k!#(B

$B
UNIX$B$N%7%0%J%k$KBP1~$7$?=hM}$r5-=R$7$?$$!#(B
$B2sEz!'(B
UNIX$B$N%7%0%J%k%O%s%I%i$NCf$G(BXlib/Xt/Xm$B$N4X?t$r8F$V$H!"(BXlib$B$d(BXt$B$NFb(B $BIt>uBV$KIT@09g$,@8$8$k$N$G8F$s$G$O$$$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$$!#(B

$B%@%$%"%m%0%\%C%/%9$N%j%5%$%:$r6X;_$9$k$K$O!"(BBulletinBoard$B$N%j%=!<%9(B XmNnoResize$B$NCM$r(BTrue$B$K$9$l$P$h$$!#(B

    Arg dialog_args[] = {
        { XmNnoResize, True }
    };
    ...
    dialog = XmCreateMessageDialog(top, "message",
               dialog_args, XtNumber(dialog_args));
XmCreateMessageDialog()$B$,!"(BDialogShell$B$H(BMessageBox$B$r:n@.$9(B $B$k$3$H!"(BXmNnoResize$B$N;XDj$,(BMessageBox$B$KEO$5$l$k$3$H$KCm0U(B $B$7$F$[$7$$!#(B

$B%a%$%s%&%#%s%I%&$G%j%5%$%:$r6X;_$9$k>l9g$O!"(BVendorShell$B$N%j%=!<%9(B XmNmwmFunctions$B$rMxMQ$9$k!#(B

    top = XtAppInitialize(&app, "Sample", NULL, 0, &ac, av,
                          NULL, NULL, 0);
    /* $B%a%$%s%&%#%s%I%&$N%j%5%$%:$r6X;_(B */
    XtVaSetValues(top,
                  XmNmwmFunctions, MWM_FUNC_ALL | MWM_FUNC_RESIZE,
                  NULL);
XmNmwmFunctions$B$K$D$$$F$O(BVendorShell$B$N(Bman$B%Z!<%8$r;2>H$7$F(B $B$[$7$$!#$A$J$_$K!"(B
Motif $B%W%m%0%i%_%s%0%^%K%e%"%k(B$B$N(B17.3$B@a$N(BMWM_FUNC_ALL$B$N@bL@$O(B $BE,@Z$G$O$J$$!#(B

$B0J>e$r$^$H$a$?(B$B%5%s%W%k%W%m%0%i%`(B


$B
mwm$B0J30$N%&%#%s%I%&%^%M!<%8%c$G$b%&%#%s%I%&$N%j%5%$%:$r6X;_$7$?$$(B
$B2sEz!'(B
WMShell$B%/%i%9$N(BXmNmaxWidth$B$H(BXmNminWidth$B!"(B XmNmaxHeight$B$H(BXmNminHeight$B$K$=$l$>$lF1$8%5%$%:$r(B $B;XDj$9$k$H!"$[$H$s$I$N%&%#%s%I%&%^%M!<%8%c$O%f!<%6$K$h$k%j%5%$%:$r(B $B6X;_$7$F$/$l$k!#$D$$$G$K!"%W%m%0%i%`<+?H$K$h$k%j%5%$%:$b6X;_$5$l$k(B $B$N$,F,$NDK$$$H$3$m$@!#(B

$B@_Dj$9$Y$-CM$,7hDj$9$k$N$O=i4|%8%*%a%H%j8r>D$,9T$o$l$?8e$J$N$G!"@_(B $BDj$9$k%?%$%_%s%0$O(BApplicationShell$B$J$i(BXtRealizeWidget()$B$N(B $B8e!"(BDialogShell$B$O:G=i$K(BXtManageChild()$B$7$?8e$K$9$k$3$H!#(B

    Dimension width, height;
    XtVaGetValues(shell,
                  XmNwidth, &width,
                  XmNheight, &height,
                  NULL);
    XtVaSetValues(shell,
                  XmNminWidth, width,
                  XmNmaxWidth, width,
                  XmNminHeight, height,
                  XmNmaxHeight, height,
                  NULL);

$B
$B%@%$%"%m%0%\%C%/%9$NI=<($5$l$k0LCV$r%W%m%0%i%`$+$i%3%s%H%m!<%k$7$?(B $B$$(B
$B2sEz!'(B
MessageBox$B$N%j%=!<%9(BXmNdefaultPosition$B$NCM$r(BFalse $B$K$7$F!"(BXmNx$B$H(BXmNy$B$K2hLLA4BN$KBP$9$k0LCV$r@_Dj$9(B $B$l$P!"$=$N0LCV$K%@%$%"%m%0%\%C%/%9$,I=<($5$l$k!#(B

$BB>$N%&%#%s%I%&$H$NAjBP0LCV$G;XDj$9$k$H$-$K$O!"$=$N%&%#%s%I%&$r;}$C(B $B$F$$$k(BShell$B%&%#%8%'%C%H$+$i!"(BXmNx$B$H(BXmNy$B$NCM$r $B%5%s%W%k%W%m%0%i%`(B


$B
$BFCDj$N%@%$%"%m%0%\%C%/%9$r>o$K $B2sEz!'(B
$B%@%$%"%m%0$N(BXmNdialogStyle$B$K(BXmDIALOG_SYSTEM_MODAL $B$r;XDj$9$k$N$,4JC1$G$"$k!#%7%9%F%`%b!<%@%k$G$OET9g$,0-$$>l9g$K$O!"(B $BB>$N%&%#%s%I%&$K1#$5$l$?$H$-$KH/@8$9$k(BVisibilityNotify$B%$%Y(B $B%s%H$K1~$8$F!"%&%#%s%I%&$r;}$A>e$2$kJ}K!$,$"$k!#(B

$B6qBNE*$K$O!"0J2<$N$h$&$K%$%Y%s%H%O%s%I%i$rDj5A$7$F(B

#include        <X11/Xos.h>
void
VisibleEH(Widget w, XtPointer p, XVisibilityEvent *ev, Boolean *cont)
{
    if (ev->state == VisibilityUnobscured)
        return;
    XRaiseWindow(XtDisplay(w), XtWindow(w));
    return;
}
XtAddEventHandler()$B$G(BDialogShell$B$K;E9~$a$P$h$$!#(BMessageBox $B$G$O$J$/!"$=$N?F$N(BDialogShell$B$K;E9~$^$J$$$H!"(BVisibleEH()$B$N(B XRaiseWindow()$B$,@5$7$/5!G=$7$J$$$N$GMWCm0U!#(B
    dialog = XmCreateMessageDialog(top, "box1", arg, 1);
    XtAddEventHandler(XtParent(dialog), VisibilityChangeMask,
                      False, (XtEventHandler)VisibleEH, NULL);
$BFCDj$N%&%#%s%I%&$r>o$Ko$K $B$3$l$rHr$1$k$K$O!"%$%Y%s%H%O%s%I%iFb$GA02s8F$P$l$?;~9o$HHf3S$7$F!"(B $B$"$^$j$KC;;~4V$@$C$?>l9g$K$O!"(BXRaiseWindow()$B$r8F$P$J$$$h$&(B $B$K$9$l$P$h$$!#(B

$B$3$N=hM}$b4^$a$?(B$B%W%m%0%i%`A4BN(B


$B$=$NB>(B


$B
Motif$B$N%P!<%8%g%sHV9f$rD4$Y$?$$(B
$B2sEz!'(B
$B%3%^%s%I%i%$%s$G$O!"(B
    strings `which mwm` | grep OSF/Motif
$B$r strings libXm.a | grep OSF/Motif $B$G$bF1$87k2L$rF@$k$3$H$,$G$-$k$,!"$3$NJ}K!$O(B1.1$B0JA0$G$ODLMQ$7$J$$!#(B

$B%W%m%0%i%`$G%P!<%8%g%s$rH=JL$9$k:]$K$O!"%W%j%W%m%;%C%5$N%^%/%m(B XmVERSION$B!"(BXmREVISION$B!"(BXmUPDATE_LEVEL$B$,!"(B $B$=$l$>$l%P!<%8%g%sHV9f$N0l7eL\!"Fs7eL\!";07eL\$rI=$7$F$$$k!#$?$@$7!"(B Motif 1.1$B0JA0$G$O(BXmUPDATE_LEVEL$B$ODj5A$5$l$F$$$J$$!#$9$Y$F$N(B $B%P!<%8%g%s$G!"(BXmVersion$B$K(B (XmVersion * 1000 + XmREVISION)$B$NCM$,@_Dj$5$l$F$*$j!"Nc$($P(B

#if XmVersion < 1002 
$B$H$7$F!"(BMotif 1.2$B$h$jA0$N%j%j!<%9$G$"$k$3$H$rH=JL$G$-$k!#(B

$B$^$@$^$@A}$($kM=Dj$G$9!#(B
Motif$B%W%m%0%i%_%s%0$NIt20(B$B$X(B / $BF#;^$N%[!<%`%Z!<%8(B$B$X(B
Last modified: 2006/02/14 15:30:06 JST