Re: Table widgets [message #17424 is a reply to message #17422] |
Sun, 10 October 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Nils Johnson (nilsj@unixg.ubc.ca) writes:
> I have two questions about the WIDGET_TABLE command. I am trying to
> create a read-only table as part of a larger widget. It's not too
> hard to get something going, but...
>
> 1. There is a funny "gap" on the right and bottom sides of the table.
> What is the reason for this extra space, and is there any way to get
> rid of it?
Don't know about the table widget. Don't use it. :-)
> 2. I would like to set the column widths so that no text is cut off.
> Is there a relatively easy way to determine the number of pixels (or
> inches, or centimeters) a given string will take on the screen? Or
> is there some other slick way?
I once took a survey of the 10 best widget programmers I knew.
I asked them how they size their text widgets. I got 10
completely different answers. The only common thread was
that each answer bordered on voodoo. "I divide the
!D.Y_CH_SIZE system variable by the sine of the
number of characters in the widget and then multiply
that by the hypotenuse of the golden triangle." That
sort of thing.
I've been trying to figure it out for a lot of years
now, and I can't come up with anything that works
reliably in general circumstances. :-(
Cheers,
David
P.S. The XYOUTS command has a WIDTH keyword that can
be used to determine the width of a string in normalized
units. I spent about 45 minutes this morning trying to
figure some way to tie this information into a text widget
size, but didn't come up with anything. But I mention it
for what it's worth.
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|