Re: Font compatibility question [message #61421] |
Thu, 17 July 2008 10:02  |
pdoherty
Messages: 8 Registered: April 2007
|
Junior Member |
|
|
On Jul 17, 12:24 pm, David Fanning <n...@dfanning.com> wrote:
> pdoherty writes:
>> Any information would be appreciated. I'd rather not have to go
>> through this
>> whole package and add a lot of OS based case statements.
>
> My advice would be to use column and base widgets for program
> layout and don't explicitly size *anything*. But maybe it's
> too late for this excellent advice. :-(
>
> Cheers,
>
> David
> --
Thank yo fo rthe advice, but I find that *some* things need to
be sized or the program gets too ugly.
I want a base that holds a stack of widget_buttons, so I create
a column oriented base and fill it with buttons. I want all
the buttons to be the same width, so I set it. Otherwise they
are all sized by the system based on the text that labels them.
It doesn't get much uglier than that. Is there some other way
to force them to be the same? I suppose I could create bitmaps
that were the same size and held the label text, but that is
ugly programming.
I tried to avoid explicit sizing of items when I wrote this,
but found many circumstances in which that led to a very ugly
layout.
- Peter Doherty
|
|
|
|
Re: Font compatibility question [message #61518 is a reply to message #61421] |
Thu, 17 July 2008 10:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pdoherty writes:
> I want a base that holds a stack of widget_buttons, so I create
> a column oriented base and fill it with buttons. I want all
> the buttons to be the same width, so I set it. Otherwise they
> are all sized by the system based on the text that labels them.
> It doesn't get much uglier than that. Is there some other way
> to force them to be the same? I suppose I could create bitmaps
> that were the same size and held the label text, but that is
> ugly programming.
What version of IDL are you running!? This code creates
a stack of buttons all the same size on both my Windows
and UNIX machines:
tlb = Widget_Base(/COLUMN)
b = Widget_Button(tlb, Value='12')
b = Widget_Button(tlb, Value='1234')
b = Widget_Button(tlb, Value='123456')
b = Widget_Button(tlb, Value='12345678')
b = Widget_Button(tlb, Value='1234567890')
b = Widget_Button(tlb, Value='123456789012')
b = Widget_Button(tlb, Value='12345678901234')
b = Widget_Button(tlb, Value='1234567890123456')
Widget_Control, tlb, /realize
END
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Font compatibility question [message #61520 is a reply to message #61421] |
Thu, 17 July 2008 10:09  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Jul 17, 11:02 am, pdoherty <pedohe...@earthlink.net> wrote:
> On Jul 17, 12:24 pm, David Fanning <n...@dfanning.com> wrote:
>
>> pdoherty writes:
>>> Any information would be appreciated. I'd rather not have to go
>>> through this
>>> whole package and add a lot of OS based case statements.
>
>> My advice would be to use column and base widgets for program
>> layout and don't explicitly size *anything*. But maybe it's
>> too late for this excellent advice. :-(
>
>> Cheers,
>
>> David
>> --
>
> Thank yo fo rthe advice, but I find that *some* things need to
> be sized or the program gets too ugly.
>
> I want a base that holds a stack of widget_buttons, so I create
> a column oriented base and fill it with buttons. I want all
> the buttons to be the same width, so I set it. Otherwise they
> are all sized by the system based on the text that labels them.
> It doesn't get much uglier than that. Is there some other way
> to force them to be the same? I suppose I could create bitmaps
> that were the same size and held the label text, but that is
> ugly programming.
>
> I tried to avoid explicit sizing of items when I wrote this,
> but found many circumstances in which that led to a very ugly
> layout.
>
> - Peter Doherty
I get the same size buttons for varying text lengths. For example, the
buttons created below all have the same size:
pro mg_buttonwidget_test
compile_opt strictarr
tlb = widget_base(/column)
a = widget_button(tlb, value='First button')
b = widget_button(tlb, value='B')
c = widget_button(tlb, value='last')
widget_control, tlb, /realize
end
Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
|
|
|