[EMAIL PROTECTED] wrote:
> Now if I maintain code [I] in flresource.c and put
> 
> 
> *************************
>          location.x = 20;
>          location.y = 0;
>          preedit_list = XVaCreateNestedList( 0,
>                                              XNSpotLocation, &location,
>                                               NULL);
>          XSetICValues(fl_context->xic,XNPreeditAttributes,preedit_list,0);
>          XFree(preedit_list);
> **************************
>
> into turn_on_local_input in input.c such as
>
> *******************************
> static void turn_on_local_input(FL_OBJECT * ob)
> {
>     SPEC *sp = ob->spec;
> 
>     printf("Turning on CJK local input\n");
>     sp->CJK_local_input = 1;
> if (fl_context->xic)
>                 XDestroyIC(fl_context->xic);
> 
>         XPoint location;
>         location.x = 20;
>         location.y = 0;
>         XVaNestedList preedit_list;
>         XVaNestedList status_list;
> 
>         preedit_list = XVaCreateNestedList( 0,
>                                            XNSpotLocation, &location,
> //                                           XNFontSet, fontset,
>                                             NULL);
>          XSetICValues(0,XNPreeditAttributes,preedit_list,0);
>         
>           XFree(preedit_list);
> }
> *********************************
> 
> I should expect the same effect, right? Wrong! No change of xic. That is,
> with this input.c, the composition starts at (x=0,y=0) instead of
> (x=20,y=0). What goes wrong here?  I'm sure you get me right this time.

Dear CG, thanks for the explanation. I now understand that we need only one 
IC (per dialog?) and that we can change it's position using XSetICValues. 
Great, I've learnt something new.

However, and without meaning to be rude, your code in input.c is barmy ;-)

1. No IC exists anymore:
        if (fl_context->xic)
                XDestroyIC(fl_context->xic);
2. You are setting the value of a null IC
        XSetICValues(0,XNPreeditAttributes,preedit_list,0);

What happens if you remove the lines of 1 and modify two to
        XSetICValues(fl_context->xic,XNPreeditAttributes,preedit_list,0);
as it is in your example II.

-- 
Angus

Reply via email to