Hello, Angus; I have found that internally fl_context->xic is always set to zero corresponding to each input from the keyboard, which is bad for XmbLookupString because it gives segfaults when fl_context->xic=0.
I think the reason why this is so is that the "XCreateIC" in lib/flresource.c has too few arguments. That is, we have to provide at least PreeditAttributes and StatusAttributes in addition to the input style for XCreateIC. Over the weekend, I have tried several attempts to get the appropriate attributes, but none has succeeded. During these attempts, however, I have found that with a few example attributes I could input CJK characters from the keyboard to xforms box such as Edit->Search & Replace box in CJK-LyX through my local input method! So the remaining task for i18n of xforms-library is really to find the appropriate attributes for XCreateIC. Do you have any idea ? One of my previous attempts was to import the attributes from lyxim.C in CJK-LyX into xforms. In lyxim.C we used the "x" and "y" position as well as width and height of the work_area of the current BufferView to get the position and the size of the preedit area and the cursor position. Since this "work_area" is FL_OBJECT in XWorkArea.h, there must be corresponding "work_area" in xforms but I could not find the one. Can you or any other expert in lyx as well as xforms give me any clues ? Because of this lingering problem, I could not have tested your xforms patch. Sorry. Best regards, cghan