From: togata@iscnvx.lmsc.lockheed.com (Thomas V. Ogata)
Newsgroups: comp.windows.x.motif
Subject: Re: Positioning option menus -- AAAARRRGGGGHHHH !!!
Date: 2 Sep 92 14:43:40 GMT
Organization: Lockheed Missiles and Space Co.
X-Newsreader: Tin 1.1 PL4

jxt@stc06.ctd.ornl.gov (TOLLIVER J S) writes:
: Motif and I are fighting this one out. So far, Motif is winning. I have
: an option menu and another push button below the option menu. Both are in
: a form (for reasons external to this particular problem). I want the button
: to line up with the option menu button. Like this:
: 
:    +-----------------------------------+
:    |        +--------------------+     |<------ this is the form
:    | label  |   One          [ ] |<----|--------this is the option menu
:    |        +--------------------+     |
:    |                                   |
:    |        +--------------------+     |
:    |        |       Button       |<----|--------this is the push button
:    |        +--------------------+     |
:    |                                   |
:    +-----------------------------------+
:             ^                    ^
:             |                    |
:          I want the left and right sides to line up like this.
: 
: 
: Both the option menu and the push button are placed with XmNrightAttachment at
: XmATTACH_POSITION = 90. The option menu's XmNleftAttachment is
: XmATTACH_POSITION = 10.
: 
: Then the push button's left attachment may be attached to the option menu
: with an offset of the width of the option menu's label gadget + 6. The 6
: is probably tied up with default margin widths around labels and option
: menus (though I can only account for 5 in the documentation -- 3 for the
: option menu and 2 for the label).
: 
: Here's what I get:
: 
:                           oops
:                             |
:                             V
:    +-----------------------------------+
:    |        +---------------+          |
:    | label  |   One     [ ] |          |
:    |        +---------------+          |
:    |                                   |
:    |        +--------------------+     |
:    |        |       Button       |     |
:    |        +--------------------+     |
:    |                                   |
:    +-----------------------------------+
: 
: The right edge of the option menu seems to defy my attempts to position it.
: No amount of XmNrightAttachment seems to affect it. Neither on the option
: menu itself nor the option menu's button gadget. It's size seems to be
: determined solely by the width of the items in the menu. Setting XmNwidth
: similarly does nothing useful.
: 
: Curiously, turning on border widths shows that the space allotted to the option
: menu does, in fact, extend out to the same right position as the space allotted
: to the push button. It's just the option menu button gadget that refuses
: to size
: itself like I want. I've tried PACK_COLUMN instead of the default
: PACK_TIGHT
: for the option menu (which is really a RowColumn) to no avail.
: 
: Surely, there must be a way to do this. Any ideas?
: 
: Thanks,
: Johnny Tolliver
: Oak Ridge National Laboratory
: jxt@ornl.gov

My quick fix for this problem has been to add a margin width to the first push
button inside the option menu.


------------------------------------------------------------------------------
Tom Ogata                              Lockheed Missiles and Space Co., Inc.
togata@lmsc.lockheed.com               P.O.Box 3504
(408)743-2878                          B/551 O/77-10
                                       Sunnyvale, CA 94088-3504

             (If you think this signature is boring,
            you should listen to my answering machine.)
-- 
------------------------------------------------------------------------------
Tom Ogata                              Lockheed Missiles and Space Co., Inc.
togata@lmsc.lockheed.com               P.O.Box 3504
(408)743-2878                          B/551 O/77-10
Newsgroups: comp.windows.x.motif