[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: botton size ?
In article <38f1eaa1$0$26046@news.execpc.com>,
"pei zeng" <pei@prism-cs.com> writes:
> Hi,
>
> I have a dumb question: when I place 3 button with value 'Apply', 'OK' and
> 'Cancel', respectively, in one row, the buttons will have different size,
> and I can not find a way to make them have the exact same size. Can anybody
> help me?
>
> thanks
Hi,
The GRID_LAYOUT keyword to WIDGET_BASE will do
this in a portable way:
base = WIDGET_BASE (/COLUMN)
grid = WIDGET_BASE (base, COLUMN = 3, /GRID_LAYOUT)
b1 = WIDGET_BUTTON (grid, VALUE = 'Button 1')
b2 = WIDGET_BUTTON (grid, VALUE = 'Button 2, with more text')
b3 = WIDGET_BUTTON (grid, VALUE = 'B')
WIDGET_CONTROL, /REALIZE, base
All buttons will be as wide as the widest "natural width"
button. The natural widths are derived from the button labels.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code SD 50
http://gammaray.msfc.nasa.gov/ Marshall Space Flight Center
http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~