kquick@dcs.simpact.com (Kevin Quick, Simpact Assoc., Inc.) (06/19/91)
A while back I posted a question asking what dialog gave you the ability to place pushbuttons in a window that were all the same size and have the size remain constant and each button's relative position remain constant while the window moved around. As a nifty addition, the buttons would be stacked in columns or rows as necessary to fit them into the available size of the window. If all of this is obscure, what I`m trying to describe is the way the selection box dialog handles its buttons; try it out and you'll see what I mean. Judging from the responses, nobody knows of an underlying dialog that provides this functionality exactly, although all responses were good recommendations for a workaround. The responses generally fell into two categories: 1. Use the form dialog. Create the pushbuttons, calculating the maximum size and explicitly setting the size of all other buttons to that maximum. Attach all buttons to the form on the top and left, calculating a relative position for leftmost placement. Advantages: uses well documented facilities and allows tweaking of the result for other desired effects. Disadvantages: Does not re-stack if the window gets too small, and quite a lot of calculation and fore-knowledge is needed when setting things up. 2. Use the selection box dialog and unmanage everything except the pushbuttons, using XtGetChild and XtSetValues to change the labels of those buttons to the desired text. Advantages: easy to setup and requires minimal program interaction Disadvantages: no support for more than 4 pushbuttons Thanks to all who answered. It appears that one of the above two methods should be sufficient for most needs, but it would have been nice if the Motif developers made the same functionality available to the user's as they use internally. -- -- Kevin Quick, Simpact Associates, Inc., San Diego, CA. UUCP: kquick@simpact.com (or simpact!kquick@crash.cts.com)