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
Re: Predicting string lengths in widgets [message #55235 is a reply to message #55142] Mon, 06 August 2007 09:40 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Aug 6, 5:41 am, mattf <mfe...@earthlink.net> wrote:
> 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?

Check out the STRING_SIZE keyword to WIDGET_INFO. (IDL 6.2+ required.)

Mike
--
www.michaelgalloy.com
[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 21:10:10 PDT 2025

Total time taken to generate the page: 7.68223 seconds