Re: Table Layout? [message #46687] |
Tue, 06 December 2005 09:56 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
hocmin@gmail.com writes:
> I'm trying set up a simple two column window where I've got a label in
> the left column and some corresponding data in the right. The problem
> is, I can't seem to figure out how you can accomplish this in IDL
> without alignment problems.
>
> It seems like I can only control over rows OR columns; not both. If I
> write a loop that generates row widget_base's, for each pair, I can't,
> for example, align the left one left-justified and the right one right
> justified. If I write a loop that creates two column bases, my right
> widget ends up taking more vertical spacing and the elements get out of
> alignment.
>
> Is there a way to maintain some sort of table layout where you can have
> both rows and columns of equal size? Or is the only way to do that by
> setting them absolutely via xsize/ysize or scr_xsize/scr_ysize?
Ah, someone--finally!--as anal as I am. :-)
Aligning this kind of widget layout can be a nightmare. I've
resorted to write compound "field" widgets that have properties
that allow me to do the aligning property. I can stick 8-10
of these field widgets into a column base and everything is
aligned in nice even spaces. Run the example program of either
of these two field widgets to see what I mean:
http://www.dfanning.com/programs/fsc_field.pro
http://www.dfanning.com/programs/fsc_inputfield.pro
The only difference between the two is that one returns
a widget ID and the other returns an object reference.
Both have the ability to obtain the object reference, which
is what you need to do the alignment successfully from
your program. The Change Size of Labels button in the
Example program will illustrate how.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|