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

Home » Public Forums » archive » Re: 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 #55141] Mon, 06 August 2007 05:07
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mattf writes:

> 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?

No. :-)

Cheers,

David

P.S. Did you put the phase of the moon into your fudge
factor? That sometimes helps, too.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: Re: Call_External error in Virtual Machine
Next Topic: Predicting string lengths in widgets

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

Current Time: Thu Oct 09 20:27:58 PDT 2025

Total time taken to generate the page: 1.19623 seconds