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

Home » Public Forums » archive » Predicting string lengths in widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Predicting string lengths in widgets [message #55142] Mon, 06 August 2007 04:41 Go to previous message
mattf is currently offline  mattf
Messages: 13
Registered: January 2007
Junior Member
Hi all...

I have a table widget and I'd like to set the column widths -before-
the table is realized so that the user doesn't have to fiddle with
adjustable widths. Unfortunately, I don't know the lengths of the
strings that I'm going to put into the table before running the
program, and the strings may be rather long. And, for a cross-platform
application, I don't know what the font will be, or, for that matter,
the size of the display.

At the moment, I'm just hacking at the problem by using a pixmap
window and the width parameter in xyouts to get an idea of the string
length in pixels, e.g., if the string is 'test_str' I do

str_max_sz
window, /free, /pixmap, xsize = str_max_sz, ysize = str_max_sz
xyouts, test_str, width = w
wdelete
str_pix_len = ceil(w*str_max_sz)

and then use a fudge factor to get good-looking column widths from
str_pix_len. But there must be a way of doing it, you know,
correctly... no?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Predicting string lengths in widgets
Next Topic: Re: Question regarding HDF file

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

Current Time: Sat Oct 11 12:12:32 PDT 2025

Total time taken to generate the page: 0.31952 seconds