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

Home » Public Forums » archive » Re: Right justifying text
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: Right justifying text [message #18155 is a reply to message #18146] Thu, 02 December 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Robert S. Mallozzi (Robert.Mallozzi@msfc.nasa.gov) writes:

> If you set the size of the text area explicitly, you
> could do something like this:
>
> xsize = 40
> ysize = 1
> base = WIDGET_BASE (/COLUMN)
> text = WIDGET_TEXT (base, XSIZE = xsize, YSIZE = ysize, VALUE = '')
> WIDGET_CONTROL, /REALIZE, base
>
> num = 10.00
> fmt = "(F" + STRTRIM (xsize, 2) + ".2)" ; F40.2
>
> str = STRING (num, FORMAT = fmt)
> WIDGET_CONTROL, text, SET_VALUE = str
>
> You could make the number of digits after the decimal point a
> parameter as well; here I just hardcoded it to 2.

Humm. Maybe if you have a non-proportionally spaced
font in the text widget, but I doubt otherwise. A
table widget allows you to justify text. Maybe
Phil Aldis will write us a nice CW_FIELD-like compound
widget object that uses a Table Widget rather than a text
widget. :-)

Cheers,

David
--
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Help needed with reading ASCII data
Next Topic: Re: Why Object Widgets

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

Current Time: Fri Oct 10 03:38:37 PDT 2025

Total time taken to generate the page: 0.32010 seconds