button - fixed size

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
button - fixed size

Submitted by piotrek on Sat, 05/22/2010 - 07:27. General Questions
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

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

fredk

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