Re: Table widgets [message #17404] |
Tue, 12 October 1999 00:00  |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
David Fanning wrote:
>
> Nils Johnson (nilsj@unixg.ubc.ca) writes:
>
>> : Don't know about the table widget. Don't use it. :-)
>>
>> So what do you use to get a bunch of strings on the screen so
>> that it looks like columns of text? Is the table widget overkill
>> for doing this if I just want to display data and not have it be
>> modified by the user?
>
> Oh, it might be just the thing for this purpose. I don't
> use it on principle, since I dislike it so much. I'd hack
> something--anything--together to avoid using it and my program
> would probably be worse off for it. :-)
>
>> : 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.
>>
>> How about bugging your friends at RSI to fix this so there's no
>> black magic anymore? Like getting a fixed-width font and then
>> having a UNIT setting in characters...
>
> My "friends" at RSI think I'm basically nuts and have
> long since discounted my input on user-interface issues.
> However, if *you* wrote them a note, I'd bet they would be
> much more inclined to listen to the input. :-)
>
> But if it is a fixed width font that you want, even
> I can figure out a way to size text widgets:
>
> stringValue='This is text'
> textID = Widget_Text(tlb, Value=stringValue, $
> XSize=StrLen(stringValue), Font='Courier*12')
>
Unix IDL users can use this code snippet:
window,/free,/pixmap,xs=4, ys=4
device,get_fontnames=df,font='*cour*medium-r-normal*--12*'
if n_elements(df) ne 0 then dispfont=df[0]
wdelete, !d.window
to get a fixed-spaced font. I often have users run a routine which
does:
if n_elements(dispfont) ne 0 then widget_control, DEFAULT_FONT=dispfont
To get all fixed spacing fonts in session using software I've written.
JD
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
|
|
|