Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Input methods for OpenMotif?

33 views
Skip to first unread message

moorecm

unread,
Dec 15, 2009, 2:23:18 PM12/15/09
to
Has anyone successfully used an input method for another language,
such as Chinese, with an OpenMotif application?

I am trying to use SCIM to input Chinese into an OpenMotif 2.3.2
application's XmTextField on RHEL 5. I have exported
XMODIFIERS=@im=SCIM but cannot get the input method to appear via Ctrl-
space. SCIM pops up via Ctrl-space for other applications, such as an
xterm.

Thank you!

Aaron W. Hsu

unread,
Dec 17, 2009, 8:22:31 PM12/17/09
to
moorecm <moo...@switch.com> writes:

>Has anyone successfully used an input method for another language,
>such as Chinese, with an OpenMotif application?

I took a look at this, and I have a few questions.

>I am trying to use SCIM to input Chinese into an OpenMotif 2.3.2
>application's XmTextField on RHEL 5. I have exported
>XMODIFIERS=@im=SCIM but cannot get the input method to appear via Ctrl-
>space. SCIM pops up via Ctrl-space for other applications, such as an
>xterm.

I read the documentation on Open Motif 2.1, and it appears that input
methods that are compatible with XIM are indeed automatically registered
and used with Text and TextField widgets. However, I would first ask
what specific Motif application you want this to work with? I know that
the one I use most often, NEdit, doesn't support UTF-8 or other
character sets in that way, so I would not expect to get much from them.

I did however try to create my own little mini-application with just a
text field, to see if I could get something working. I didn't get very
far. Everything I tried did not work. I am not sure why though.

Specifically, it seems like there are a couple of resources that would need to
be considered here: inputMethod and preeditType. I saw some things about
using these, but they were in Chinese, and I did not understand them.
Also, it appears from Sun documentation that you need to make sure that
you have the right fontList setup. I don't know how to do that
appropriately, yet, but maybe you would be able to play around with it.

Maybe someone else here knows a bit more about using Input Methods with
Motif? Obviously it is very possible, and it shouldn't be too hard, but
I don't see the simple HOW-TO, and I think something is eluding me with
the limited amount of time I have to put into it.

Aaron W. Hsu
--
A professor is one who talks in someone else's sleep.

moorecm

unread,
Dec 18, 2009, 1:11:03 PM12/18/09
to
On Dec 17, 8:22 pm, Aaron W. Hsu <arcf...@sacrideo.us> wrote:
> I read the documentation on Open Motif 2.1, and it appears that input
> methods that are compatible with XIM are indeed automatically registered
> and used with Text and TextField widgets. However, I would first ask
> what specific Motif application you want this to work with? I know that
> the one I use most often, NEdit, doesn't support UTF-8 or other
> character sets in that way, so I would not expect to get much from them.

It's an application I am developing/maintaining at work. I have
created a simple test application that has just an XmTextField to get
the input method working first, then I'll apply the "fix" to the real
target application.

> I did however try to create my own little mini-application with just a
> text field, to see if I could get something working. I didn't get very
> far. Everything I tried did not work. I am not sure why though.

We both share the same result.

> Specifically, it seems like there are a couple of resources that would need to
> be considered here: inputMethod and preeditType. I saw some things about
> using these, but they were in Chinese, and I did not understand them.
> Also, it appears from Sun documentation that you need to make sure that
> you have the right fontList setup. I don't know how to do that
> appropriately, yet, but maybe you would be able to play around with it.

Yes! I have read through some documentation (it's hard to find these
days) and the XmNinputMethod resource could be used to specify which
XIM server to connect to. If I remember correctly, *inputMethod: SCIM
would internally construct "@im=SCIM" and call the XSetLocaleModifiers
function. I think the man pages for XSetLocaleModifiers said that it
would then append the value of the XMODIFIERS environment variable,
such that using the inputMethod resource should not even be necessary
if XMODIFIERS=@im=SCIM in the environment. I tried each of the values
for *preeditType but there were the same results.

I have been using a Unicode XFreeType font that supports both English
and Chinese characters but rather than a fontList, I am using a render
table rendition. I will try not using the render table and see if
that isolates the problem.

> Maybe someone else here knows a bit more about using Input Methods with
> Motif? Obviously it is very possible, and it shouldn't be too hard, but
> I don't see the simple HOW-TO, and I think something is eluding me with
> the limited amount of time I have to put into it.
>
>   Aaron W. Hsu
> --
> A professor is one who talks in someone else's sleep.

Thanks for the response. I need all the help I can get! ;)

Aaron W. Hsu

unread,
Dec 19, 2009, 3:55:07 AM12/19/09
to
moorecm <moo...@switch.com> writes:

>It's an application I am developing/maintaining at work. I have
>created a simple test application that has just an XmTextField to get
>the input method working first, then I'll apply the "fix" to the real
>target application.

Okay, in that case, you definitely should check out the sample program
that I discovered in the Open Motif sources call i18ninput. It's exactly
what you want. It works like a charm.

>Yes! I have read through some documentation (it's hard to find these
>days) and the XmNinputMethod resource could be used to specify which
>XIM server to connect to. If I remember correctly, *inputMethod: SCIM

>would internally construct "@im=3DSCIM" and call the XSetLocaleModifiers


>function. I think the man pages for XSetLocaleModifiers said that it
>would then append the value of the XMODIFIERS environment variable,
>such that using the inputMethod resource should not even be necessary

>if XMODIFIERS=3D@im=3DSCIM in the environment. I tried each of the values


>for *preeditType but there were the same results.

Yes, you don't have to mess with XmNinputMethod it seems, if the
application is written appropriately. It's good news.

>I have been using a Unicode XFreeType font that supports both English
>and Chinese characters but rather than a fontList, I am using a render
>table rendition. I will try not using the render table and see if
>that isolates the problem.

Hrm, yes, well, I haven't managed to write my own version yet, but I
think you're on the right track. I actually use 2.1.3x here (I like me
stability), so I don't know how the 2.3 XFT stuff is going to interact,
but I know that 2.1 handled the Internationalization through Xt just
fine. I was typing away in Swedish, Chinese, and the like!

>Thanks for the response. I need all the help I can get! ;)

Well, I like to support the use of Motif. I think it's a very viable
toolkit that should receive its proper recognition alongside GTK and QT.
So, of course, I'd like to help out as much as I can!

moorecm

unread,
Dec 30, 2009, 2:28:21 PM12/30/09
to
On Dec 19, 3:55 am, Aaron W. Hsu <arcf...@sacrideo.us> wrote:
> Hrm, yes, well, I haven't managed to write my own version yet, but I
> think you're on the right track. I actually use 2.1.3x here (I like me
> stability), so I don't know how the 2.3 XFT stuff is going to interact,
> but I know that 2.1 handled the Internationalization through Xt just
> fine. I was typing away in Swedish, Chinese, and the like!

The i18ninput demo program with OpenMotif 2.3.x does not work with
SCIM. I downloaded 2.1.32 and
it worked. All I had to do was set the environment variable
XMODIFIERS to @im=SCIM and all was well.

I am going to submit a bug to MotifZone and start looking deeper into
libXm in version 2.3.2.

moorecm

unread,
Jan 25, 2010, 3:06:55 PM1/25/10
to

Update! I must have made a mistake while testing i18ninput. The demo
program works on all versions that I had previously tried.

I also finally have my software working with SCIM, as well. I had to
set XMODIFIERS, call XtSetLanguageProc and XSetLocaleModifiers
explicitly before my X event loop, and use a fontType of
FONT_IS_FONTSET.

I have updated the bug report, such that the input method should be
made compatible with Unicode XFreeType fonts.

0 new messages