From: matsuo@kiso.ee.saga-u.ac.jp (Masaaki Matsuo)
Newsgroups: fj.windows.x
Subject: i18n client
Date: 18 Nov 92 08:19:48 GMT
Distribution: fj
Organization: Instrumentation & Computer Science Laboratory, Saga University


  $@$3$s$K$A$O!">>Hx(J@$@:42lBg3X$G$9(J

  R5 $@$N(J contrib/clients/xpostit $@$N%=!<%9$r8+$F7k9=4JC1$K4A;z$r07(J$@$&$3$H(J
$@$,$G$-$k$s$@$J$H;W$C$F$$$m$$$m;n$7$?$N$G$9$,(J xpostit $@$O$A$c$s$HF0$/$N(J
$@$K$b4X$o$i$:!"2<$N%=!<%9(J$@$O$&$^$/F0$-$^$;$s!#(J

  asciiTextWidget $@$b(J xwnmo $@$H$D$J$,$C$F$/$l$^$;$s!#(J

  $@%=!<%9$r8+$?46$8$G$O(J XtSetLanguageProc $@$r$D$1$k$@$1$N$h$&$K$b;W$($k(J
$@$N$G$9$,$I$3$,0-$$$N$G$7$g$&$+!#(J




$@%3%s%Q%$%k$O(J

gcc test.c -o test -lXaw -lXmu -lXt -lXext 
-lX11 -lXwchar -DX_LOCALE -DX_WCHAR -DXI18N
  
$@<B9T$O(J

xrdb -merge XTest
./test

$@$H$7$^$7$?!#(J



XTest  ---8<------8<------8<------8<------8<------8<------8<------8<---
*label.label:		$@4A;zF~$k!)(J
!*label.label:		this is alphabet
*label.height:		300
*label.width:		300
!*ascii.string:		$@4A;zF~$i$J$$(J
*ascii.string:		this is alphabet,too
*ascii.height:		300
*ascii.width:		300
test.c  ---8<------8<------8<------8<------8<------8<------8<------8<---
/*
 *
 *	test
 *
 */


#include	<stdio.h>

/*
 *	X Tool kit
 */

#include	<X11/Intrinsic.h>
#include	<X11/StringDefs.h>

/*
 *	Athena Widget
 */

#include	<X11/Shell.h>
#include	<X11/Xaw/Cardinals.h>
#include	<X11/Xaw/Form.h>
#include	<X11/Xaw/AsciiText.h>
#include	<X11/Xaw/Label.h>


typedef struct {
	Pixel	fg;				/* $@%U%)(J$@%"%0%i%s%I(J	*/
	Pixel	bg;				/* $@%P%C%/%0%i%s%I(J	*/
} ApplicationData,*ApplicationDataPtr;

static
String fallback_resources[] = { 
	"*label.label:		nande umaku ugokan?",
	NULL
};

static XtResource resources[] = {
	{
		XtNforeground, XtCForeground,
		XtRPixel, sizeof(Pixel),
		XtOffset(ApplicationDataPtr,fg), XtRString, 
		XtDefaultForeground
	},
	{
		XtNbackground, XtCBackground, 
		XtRPixel, sizeof(Pixel),
		XtOffset(ApplicationDataPtr,bg), XtRString, 
		XtDefaultBackground
	}
};

XtAppContext	app_con;
ApplicationData	App_data;
Widget		toplevel;


void
main(int argc,char **argv)
{

	Widget	w_form;
	Widget	w_label;
	Widget	w_ascii;

#ifdef XI18N
        XtSetLanguageProc(NULL, NULL, NULL);
#endif

	/*
	 *	$@%G%#%9%W%l%$$H$N@\B3(J,$@=i4|2=(J
	 */


	toplevel = XtVaAppInitialize(&app_con, "XTest",
				     NULL, ZERO,	/* $@%*%W%7%g%s(J */
				     &argc, argv,	/* $@%3%^%s%I%i%$%s(J */
				     fallback_resources, /* $@%j%=!<%9(J */
				     NULL );
	if (argc != 1)	XtError("unknown option");

	/*
	 *	$@%j%=!<%9$N2r@O(J
	 */

	XtGetApplicationResources(toplevel, &App_data, 
				  resources, XtNumber(resources),
				  NULL, ZERO);

	/*
	 *	$@%&%$%s%I%&@8@.(J
	 */

	w_form 
		=XtVaCreateManagedWidget("form", formWidgetClass,
					 toplevel,
					 NULL);

	w_label
		=XtVaCreateManagedWidget("label", labelWidgetClass,
					 w_form,
					 /* XtNheight, 300, */
					 /* XtNwidth, 300, */
					 NULL);

	w_ascii
		= XtVaCreateManagedWidget("ascii", asciiTextWidgetClass,
					  w_form,
					  /* XtNstring, "??\n", */
					  XtNfromVert, (XtArgVal)w_label,
					  XtNheight, (XtArgVal)100,
					  XtNscrollHorizontal, 
					  	XawtextScrollWhenNeeded,
					  XtNscrollVertical,
					  	XawtextScrollWhenNeeded,
					  XtNeditType, XawtextEdit,
					  XtNuseStringInPlace, False/*True*/,
					  NULL);


	/*
	 *	$@%&%$%s%I%&%j%"%i%$%:(J
	 */
	
	XtRealizeWidget(toplevel);


	/*
	 *	$@%a%$%s%k!<%W(J
	 */

	
	XtAppMainLoop(app_con);

}

---8<------8<------8<------8<------8<------8<------8<------8<---


---
--
		$@:42lBg3XEE5$9)3X2J(J
		    $@>>Hx6)>O(J
		matsuo@kiso.ee.saga-u.ac.jp
Newsgroups: fj.windows.x