home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / fj / windows / x / 934 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.8 KB  |  196 lines

  1. Path: sparky!uunet!ccut!sh.wide!wnoc-kyo!kyu-cs!hakata!sagagw!matsuo
  2. From: matsuo@kiso.ee.saga-u.ac.jp (Masaaki Matsuo)
  3. Newsgroups: fj.windows.x
  4. Subject: i18n client
  5. Message-ID: <MATSUO.92Nov18171948@kisosun1.kiso.ee.saga-u.ac.jp>
  6. Date: 18 Nov 92 08:19:48 GMT
  7. Sender: news@sagagw.cc.saga-u.ac.jp
  8. Distribution: fj
  9. Organization: Instrumentation & Computer Science Laboratory, Saga University
  10. Lines: 184
  11.  
  12.  
  13.   $@$3$s$K$A$O!">>Hx(J@$@:42lBg3X$G$9(J
  14.  
  15.   R5 $@$N(J contrib/clients/xpostit $@$N%=!<%9$r8+$F7k9=4JC1$K4A;z$r07(J$@$&$3$H(J
  16. $@$,$G$-$k$s$@$J$H;W$C$F$$$m$$$m;n$7$?$N$G$9$,(J xpostit $@$O$A$c$s$HF0$/$N(J
  17. $@$K$b4X$o$i$:!"2<$N%=!<%9(J$@$O$&$^$/F0$-$^$;$s!#(J
  18.  
  19.   asciiTextWidget $@$b(J xwnmo $@$H$D$J$,$C$F$/$l$^$;$s!#(J
  20.  
  21.   $@%=!<%9$r8+$?46$8$G$O(J XtSetLanguageProc $@$r$D$1$k$@$1$N$h$&$K$b;W$($k(J
  22. $@$N$G$9$,$I$3$,0-$$$N$G$7$g$&$+!#(J
  23.  
  24.  
  25.  
  26.  
  27. $@%3%s%Q%$%k$O(J
  28.  
  29. gcc test.c -o test -lXaw -lXmu -lXt -lXext 
  30. -lX11 -lXwchar -DX_LOCALE -DX_WCHAR -DXI18N
  31.   
  32. $@<B9T$O(J
  33.  
  34. xrdb -merge XTest
  35. ./test
  36.  
  37. $@$H$7$^$7$?!#(J
  38.  
  39.  
  40.  
  41. XTest  ---8<------8<------8<------8<------8<------8<------8<------8<---
  42. *label.label:        $@4A;zF~$k!)(J
  43. !*label.label:        this is alphabet
  44. *label.height:        300
  45. *label.width:        300
  46. !*ascii.string:        $@4A;zF~$i$J$$(J
  47. *ascii.string:        this is alphabet,too
  48. *ascii.height:        300
  49. *ascii.width:        300
  50. test.c  ---8<------8<------8<------8<------8<------8<------8<------8<---
  51. /*
  52.  *
  53.  *    test
  54.  *
  55.  */
  56.  
  57.  
  58. #include    <stdio.h>
  59.  
  60. /*
  61.  *    X Tool kit
  62.  */
  63.  
  64. #include    <X11/Intrinsic.h>
  65. #include    <X11/StringDefs.h>
  66.  
  67. /*
  68.  *    Athena Widget
  69.  */
  70.  
  71. #include    <X11/Shell.h>
  72. #include    <X11/Xaw/Cardinals.h>
  73. #include    <X11/Xaw/Form.h>
  74. #include    <X11/Xaw/AsciiText.h>
  75. #include    <X11/Xaw/Label.h>
  76.  
  77.  
  78. typedef struct {
  79.     Pixel    fg;                /* $@%U%)(J$@%"%0%i%s%I(J    */
  80.     Pixel    bg;                /* $@%P%C%/%0%i%s%I(J    */
  81. } ApplicationData,*ApplicationDataPtr;
  82.  
  83. static
  84. String fallback_resources[] = { 
  85.     "*label.label:        nande umaku ugokan?",
  86.     NULL
  87. };
  88.  
  89. static XtResource resources[] = {
  90.     {
  91.         XtNforeground, XtCForeground,
  92.         XtRPixel, sizeof(Pixel),
  93.         XtOffset(ApplicationDataPtr,fg), XtRString, 
  94.         XtDefaultForeground
  95.     },
  96.     {
  97.         XtNbackground, XtCBackground, 
  98.         XtRPixel, sizeof(Pixel),
  99.         XtOffset(ApplicationDataPtr,bg), XtRString, 
  100.         XtDefaultBackground
  101.     }
  102. };
  103.  
  104. XtAppContext    app_con;
  105. ApplicationData    App_data;
  106. Widget        toplevel;
  107.  
  108.  
  109. void
  110. main(int argc,char **argv)
  111. {
  112.  
  113.     Widget    w_form;
  114.     Widget    w_label;
  115.     Widget    w_ascii;
  116.  
  117. #ifdef XI18N
  118.         XtSetLanguageProc(NULL, NULL, NULL);
  119. #endif
  120.  
  121.     /*
  122.      *    $@%G%#%9%W%l%$$H$N@\B3(J,$@=i4|2=(J
  123.      */
  124.  
  125.  
  126.     toplevel = XtVaAppInitialize(&app_con, "XTest",
  127.                      NULL, ZERO,    /* $@%*%W%7%g%s(J */
  128.                      &argc, argv,    /* $@%3%^%s%I%i%$%s(J */
  129.                      fallback_resources, /* $@%j%=!<%9(J */
  130.                      NULL );
  131.     if (argc != 1)    XtError("unknown option");
  132.  
  133.     /*
  134.      *    $@%j%=!<%9$N2r@O(J
  135.      */
  136.  
  137.     XtGetApplicationResources(toplevel, &App_data, 
  138.                   resources, XtNumber(resources),
  139.                   NULL, ZERO);
  140.  
  141.     /*
  142.      *    $@%&%$%s%I%&@8@.(J
  143.      */
  144.  
  145.     w_form 
  146.         =XtVaCreateManagedWidget("form", formWidgetClass,
  147.                      toplevel,
  148.                      NULL);
  149.  
  150.     w_label
  151.         =XtVaCreateManagedWidget("label", labelWidgetClass,
  152.                      w_form,
  153.                      /* XtNheight, 300, */
  154.                      /* XtNwidth, 300, */
  155.                      NULL);
  156.  
  157.     w_ascii
  158.         = XtVaCreateManagedWidget("ascii", asciiTextWidgetClass,
  159.                       w_form,
  160.                       /* XtNstring, "??\n", */
  161.                       XtNfromVert, (XtArgVal)w_label,
  162.                       XtNheight, (XtArgVal)100,
  163.                       XtNscrollHorizontal, 
  164.                           XawtextScrollWhenNeeded,
  165.                       XtNscrollVertical,
  166.                           XawtextScrollWhenNeeded,
  167.                       XtNeditType, XawtextEdit,
  168.                       XtNuseStringInPlace, False/*True*/,
  169.                       NULL);
  170.  
  171.  
  172.     /*
  173.      *    $@%&%$%s%I%&%j%"%i%$%:(J
  174.      */
  175.     
  176.     XtRealizeWidget(toplevel);
  177.  
  178.  
  179.     /*
  180.      *    $@%a%$%s%k!<%W(J
  181.      */
  182.  
  183.     
  184.     XtAppMainLoop(app_con);
  185.  
  186. }
  187.  
  188. ---8<------8<------8<------8<------8<------8<------8<------8<---
  189.  
  190.  
  191. ---
  192. --
  193.         $@:42lBg3XEE5$9)3X2J(J
  194.             $@>>Hx6)>O(J
  195.         matsuo@kiso.ee.saga-u.ac.jp
  196.