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 #18156 is a reply to message #18155] Thu, 02 December 1999 00:00 Go to previous message
robert.mallozzi is currently offline  robert.mallozzi
Messages: 11
Registered: November 1999
Junior Member
In article <3846E255.EA3BB3FB@va.aetc.com>,
Bernard Puc <bpuc@va.aetc.com> writes:
> Hello,
>
> Does anyone have a method of right-justifying text in a text widget?
> I'm trying to display a single floating point numeral in a widget_text
> field.
> Thanks for any ideas.


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.

Regards,

-bob






--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code SD 50
http://gammaray.msfc.nasa.gov/ Marshall Space Flight Center
http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
[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 07:02:19 PDT 2025

Total time taken to generate the page: 0.40209 seconds