comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Widget_base woes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Widget_base woes [message #46538 is a reply to message #46451] Thu, 24 November 2005 07:28 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Peter Albert writes:

> The problem with widgets is that the ROW
> and COLUMN keywords just work weired. Setting ROW=n will create n rows
> in the end, however, subseqent elements are put in subsequent columns.
> Just an example:
>
> base=widget_base(row=3)
> a=widget_button(base, value="a")
> b=widget_button(base, value="b")
> c=widget_button(base, value="c")
> d=widget_button(base, value="d")
> widget_control, base, /real
>
> will create a widget which looks loke this:
>
> a b
> c
> d
>
> So we have three rows, as we defined, but not that the buttons were
> filled in row after row, that woul have been too easy ...

I agree that setting COLUMN and ROW keywords to something
other than 1 results in screwy results most of the time,
but I think the algorithm it uses for layout is a reasonable
algorithm. It seems to be something like this for a ROW base:

1. Calculate the X size of the widgets that are going to go
into this base.
2. Maintaining their creation order (as I do everywhere else),
put them in X rows in such a way that I get approximately
X equal-length rows.

The problems comes about when you put things in the base that
do not have identical sizes. Since widgets are discrete things
and cannot be divided, the layout can be surprising. And it will
also be affected (usually in a negative way) by other things around
it.

In addition to sticking to COLUMN=1 and ROW=1 keywords, I sometimes
use the GRID keyword, too. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thanks....
Next Topic: Performance improvement on IDL 6.2 for Linux/MacOSX?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 17:25:13 PDT 2025

Total time taken to generate the page: 0.08054 seconds