button - fixed size

Hello.
I have been trying to write a simple programme - just a window with a button inside.
I want the button not to resize with the window - it should have fixed size and should be inextensible.
I suppose an answer for this question is very obvious, but I can't find it out.
I created the button and set XmNresizePolicy, but it still resizes while fiddling with the window size:


top_wid = XtVaAppInitialize(&app, "Push", NULL, 0,
&argc, argv, NULL, NULL);
button = XmCreatePushButton(top_wid, "Push_me", NULL, 0);
Arg args[1];
XtSetArg(args[0], XmNresizePolicy, XmRESIZE_NONE);
XtSetValues(button, args, 1);

Thanks in advance,
Piotrek.


squeen

squeen's picture

I wouldn't have guessed that

I wouldn't have guessed that it would, but try putting it in an XmForm parent.


fredk

fredk's picture

XmNresizePolicy is a

XmNresizePolicy is a resource only for BulletinBoard and DrawingArea; all other widgets will ignore it.

The shell will make its child the size of the shell, so as Piotrek has said, use some intermediate widget like a form or bulletinboard as the shell's child, and the button as a child of that intermediate widget.

--
Fred K