[comp.windows.x.motif] XmNy,XmNx problem

pasturel@sctc.com (Pierre Pasturel) (11/22/90)

I'm having a problem with setting the XmNx and XmNy resources.  
They are not always being properly set. I have brought this up in an 
earlier note, but no one responded, so I'm assuming its another one of 
Motif's annoying bugs.

I tried to counter this bug by checking the XmNx,XmNy resources after they
are set, and that in itself is giving me problems.

I have the following code to set the XmNx, XmNy resources:

Position          x_cord,y_cord;
Widget            user_token;

XtSetArg (args[0], XmNx, 725 );
XtSetValues( XtParent(user_token), args, 1);

...

XtSetArg (args[0], XmNy, 436 );  
XtSetValues( XtParent(user_token), args, 1);
    
   
where user_token is a BullentinBoard widget and its parent is an
application shell.
 
I then inserted the following to check what the resources were actually set
to:

n = 0;
XtSetArg (args[n], XmNx, &x_cord ); n++;
XtSetArg (args[n], XmNy, &y_cord ); n++;
XtGetValues( XtParent(user_token), args, n);
    
if (   (x_cord != 725)
    || (y_cord != 436)  ) {

    /* try again */
     n = 0;
     XtSetArg (args[n], XmNx, 725 ); n++;
     XtSetArg (args[n], XmNy, 436 ); n++;
     XtSetValues( XtParent(user_token), args, n);
     XFlush(display_ptr);
     printf("*** WARNING *** Motif bug 1 occurred in Enter_Token_CB.\n");
     
}


The XtGetValues() call returned a value of 436 for x_cord, and a value
of 0 for y_cord.  I expected a value of 725 for x_cord, and a value
of 436 for y_cord.

Please, any help would be greatly appreciated.
Pierre
pasturel@sctc.com