Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programmers: need motif help in Japanese



Hi,
I complied X11 with X_LOCALE and I succeeded to compile several programs
that use Xaw and Xt. But motif (Moo-Tiff) 2.0 and caldera 1.2 does not 
seem to like me. 

They can display Japanese in a label O.K. but when I create
a text widget they all  die a disgraceful death:

#0  handler (display=0x8013800, error=0xbffff4d0) at multifont.c:102
#1  0x4026710a in _XError ()
#2  0x40265a70 in _XReply ()
#3  0x402624ff in XSync ()
#4  0x40100396 in _XmImRealize ()
#5  0x4011b8aa in Realize ()
#6  0x4010ea64 in RealizeWrapper ()
#7  0x4010e823 in RealizeWrapper2 ()
#8  0x401de618 in RealizeWidget ()
#9  0x401de884 in XtRealizeWidget ()
#10 0x8001e9c in main (argc=1, argv=0xbffff738) at multifont.c:87
#11 0x8001ccb in ___crt_dummy__ ()

I need help because I want to port ML mail application.
Sample motif code included:
Background:
==========
linux-1.2.13 ot linux-2.0.24,
        libXm.so.2 => /usr/X11R6/lib/libXm.so.2.0
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6.0
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4.7
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6.0
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6.0
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6.1
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6.1
        libc.so.5 => /lib/libc.so.5.4.7
Engine: canna or wnn
IM: kinput2 version 2.0 fix 2  (1996/09/26)

--------------------------------------------------
Gaspar Sinai void(*signal(int,void(*)(int)))(int);
mailto:gsinai@example.com
http://www2.gol.com/users/gsinai/both.html
http://www2.gol.com/users/gsinai/screenshot.gif
/*
 * For Gaspar
 */

#define X_LOCALE
#include <stdio.h>
#include <Xm/XmAll.h> 
#include <X11/Xlib.h>
#include <X11/Xlocale.h>

/*
 * TAGS that are assigned by ":" indicate that motif should look for a fontset
 * in the current locale rather than a fontlist
 */
String fallbacks[] ={
"*.inputMethod: kinput2",
"*.preeditType: OverTheSpot",
"*.resize: False",
"*.labelFontList: \
*-13-*:TAG1,\
*-14-*:TAG2,\
*-24-*:TAG3",\
"*.buttonFontList: \
*-13-*:TAG1,\
*-14-*:TAG2,\
*-24-*:TAG3",\
"*.textFontList: \
*-24-*:", \
"*.fontList: \
*-24-*:", \
"*.defaultFontList: \
*-24-*:",
NULL
};

int handler(Display *, XErrorEvent *);

int
main (int argc, char ** argv)
{
	Widget toplevel;
	Widget base;
	Widget label;
	Widget textf;
	Widget button;

	XtAppContext	app;
	XmString s1,s2,s3,text,tmp;
	String	string1="This is a string ";
	String	string2="ÆüËÜ";
	String	string3="three character sets";
	ArgList	arglist;

	setlocale (LC_ALL, "ja");
	XtToolkitInitialize ();
	XtSetLanguageProc (NULL, NULL, NULL);

	toplevel = XtVaAppInitialize (&app, "String", NULL, 0,
		&argc, argv, fallbacks, NULL);

	XSetErrorHandler (handler);
	s1 = XmStringCreate (string1, "TAG1");
	s2 = XmStringCreate (string2, "TAG2");
	s3 = XmStringCreate (string3, "TAG3");

	tmp = XmStringConcat (s1,s2);
	text = XmStringConcat (tmp, s3);

	base = XtVaCreateManagedWidget ("base",
		xmRowColumnWidgetClass, toplevel,	
		NULL);

	label = XtVaCreateManagedWidget ("label1",
		xmLabelWidgetClass, base,
		XmNlabelString, text,
		NULL);

	button = XtVaCreateManagedWidget ("pushme",
		xmPushButtonWidgetClass, base,
		XmNlabelString, text,
		NULL);

	textf = XtVaCreateManagedWidget ("text1", 
		xmTextWidgetClass, base,
		XmNvalue, "", NULL);

	XtRealizeWidget (toplevel);

	XmStringFree (s1);
	XmStringFree (s2);
	XmStringFree (s3);
	XmStringFree (tmp);
	XmStringFree (text);


	XtAppMainLoop (app);
}

int
handler (Display *display, XErrorEvent *error)
{
	fprintf (stderr, "Boo:\n");
	return 1;
}

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links