[Newbie] Inextensible button - Motif
This is a discussion on [Newbie] Inextensible button - Motif ; I'm a beginner in Motif. I have been trying to create a simple window with one button. I want this button not to resize with the window. I mean the button should have fixed size and location and should not ...
| | LinkBack | Tools |
|
#1
| |||
| |||
| I have been trying to create a simple window with one button. I want this button not to resize with the window. I mean the button should have fixed size and location and should not resize while I'm fiddling with the window. Here is how I create the button: button = XmCreatePushButton(top_wid, "Push_me", NULL, 0); /* tell Xt to manage button */ XtManageChild(button); /* !! Doesn't work, button still resize with the window */ Arg args[1]; XtSetArg(args[0], XmNresizePolicy, XmRESIZE_NONE); XtSetValues(button, args, 1); /* !! Doesn't work, button still resize with the window */ What args should I set (XtSetArg()) to stop button form resizing? I'm running Mac Os X Snow Leopard, Motif built from macports. |
|
#2
| |||
| |||
| you should "lay" something(main window, for example) under the button, to do not make it a child of the toplevel widget straightforwardly. Here is the code: // gcc -o filename -lXm -lXt filename.c #include #include Widget toplevel, button, main_w; XtAppContext app; main (int argc, char *argv[]) { Arg al[10]; Cardinal ac = 0; XtSetLanguageProc (NULL, NULL, NULL); /* Initialize toolkit and parse command line options. */ toplevel = XtVaOpenApplication (&app, "btn", NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL); /* main window contains a MenuBar and a Label displaying a pixmap */ ac = 0; XtSetArg(al[ac], XmNscrollBarDisplayPolicy, XmAS_NEEDED); ac++; XtSetArg(al[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++; main_w = XmCreateMainWindow (toplevel, "main_window", al, ac); button = XmCreatePushButton(main_w, "A button", al, 0); XtManageChild (button); XtManageChild (main_w); XtRealizeWidget (toplevel); XtAppMainLoop (app); } |
« Previous Thread
|
Next Thread »
| Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Custom Button Tutorial - does button.js store javascript AND XULor just js script? | unix | Mozilla | 0 | 05-08-2008 10:34 PM |
| Conversion Key Button Labels --- Can I use my own button label description or must it be the ones you can select? | unix | Websphere | 3 | 05-08-2008 12:14 AM |
| Custom Button Tutorial - does button.js store javascript AND XUL orjust js script? | unix | Mozilla | 0 | 05-07-2008 08:26 PM |
| Hangs only on enter button or search button | unix | Mozilla | 0 | 09-05-2007 03:37 AM |
All times are GMT. The time now is 09:37 PM.
