[comp.windows.x.motif] Weird highlightThickness??

ssn@modulex.dk (Svend Skafte Nielsen) (05/13/91)

   Can anyone explain this?

   When I set the highlight thickness of a pushbutton to a value
   larger than 2 and subsequently retrieves this by XtGetValues,
   the return value is 2 lower than the actual value, although the
   pushbutton is displayed correctly, with the desired highlight
   thickness.
   I suspect it has something to do with the way rowcolumn manages
   its children, but I don't understand how and why!

   For an example, try out the code listed below.


        .
        .
   args_count = 0;
   mainw=XmCreateMainWindow(top_level,"mainw",args,args_count);
   rc=XmCreateRowColumn(mainw,"rc",args,args_count);
   bbut=XmCreatePushButton(rc,"bbut",args,args_count);
   XtManageChild(bbut);
   args_count = 0;
   XtSetArg(args[args_count],XmNhighlightThickness, 6); args_count++;
   XtSetValues(bbut,args,args_count);
   args_count = 0;
   XtSetArg(args[args_count],XmNhighlightThickness, &i); args_count++;
   XtGetValues(bbut,args,args_count);
   fprintf(stderr,"bbut.highlightthickness: %d\n",i);
   XtManageChild(rc);
   XtManageChild(mainw);
        .
        .


---------------------------------------------------
Svend Skafte Nielsen    | Email:    ssn@modulex.dk
A/S MODULEX		| Phone:    +45 44 53 30 11
Lyskaer 15		| Telefax:  +45 44 53 30 74
DK-2730 Herlev		|
Denmark			|

sydorow@bisco.kodak.com (Steve Sydorowicz) (05/14/91)

ssn@modulex.dk (Svend Skafte Nielsen) writes:

>   Can anyone explain this?
>
>   When I set the highlight thickness of a pushbutton to a value
>   larger than 2 and subsequently retrieves this by XtGetValues,
>   the return value is 2 lower than the actual value, although the
>   pushbutton is displayed correctly, with the desired highlight
>   thickness.
>   I suspect it has something to do with the way rowcolumn manages
>   its children, but I don't understand how and why!
>
>   For an example, try out the code listed below.
> [code deleted]

You did not mention which version of Motif you were using, but I think I can
still give you a reasonable answer....

Before 1.1 (or 1.1.1) the computation method for this resource in PushButton
had a bug in it related to the defaultButtonShadowThickness resource. As
you'll notice (or not :-)), the default for this resource used to be based on
showAsDefault (which was 2). Hence, the off by 2 problem. If this all seems
confusing, don't worry, it should be fixed in Motif 1.1 (and 1.1.1 and 1.1.2).

Sorry I can't be more specific, I'm recalling this from memory of about a
year ago.

If you have 1.1 or later and it is still wrong, send in a bug report to
osf@motif-defect. This *was* fixed at some point and hopefully not
re-broken.

    Steve


-- 
--------------------------------------------------------------------------------
Stephen J. Sydorowicz                                 Azatar Computer Systems
REPLY TO: sydorow@bisco.kodak.com                     (716)726-5636
		Opinions expressed do not reflect those of my employer