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

Home » Public Forums » archive » Re: WIDGET_LABEL query.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: WIDGET_LABEL query. [message #61239] Thu, 10 July 2008 09:48
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
Here's a quick copy/paste method to show it working in action -- like
David said, make sure scr_ysize or ysize is set large enough on your
widget_label.

mylabel='1stline'+string(byte(13))+'2ndline'+string(10b)+'3r dline'
dummy = widget_base(xsize=150, ysize=100)
lbl = widget_label(dummy, value=mylabel, scr_ysize=50)
widget_control, dummy, /realize

Cheers,
--jmoore
On Jul 10, 9:11 am, David Fanning <n...@dfanning.com> wrote:
> biophys writes:
>> The label widget does not seem to understand embedded formatting.
>> However, I found the string() function very helpful. The following
>> code works for me.:)
>
>> mylabel=3D"1stline"+string(byte(13))+"2ndline"
>> widget_control, label_id, set_value=3Dmylabel
>
> Wow. That's the last time I say "not possible". :-)
>
> Just be sure you give your widget enough Y size so
> you can see the label, if you try this at home.
>
> I'll probably have an article about this later today. :-)
>
> Cheers,
>
> David
> --
> 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.")
Re: WIDGET_LABEL query. [message #61267 is a reply to message #61239] Thu, 10 July 2008 06:11 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
biophys writes:

> The label widget does not seem to understand embedded formatting.
> However, I found the string() function very helpful. The following
> code works for me.:)
>
> mylabel=3D"1stline"+string(byte(13))+"2ndline"
> widget_control, label_id, set_value=3Dmylabel

Wow. That's the last time I say "not possible". :-)

Just be sure you give your widget enough Y size so
you can see the label, if you try this at home.

I'll probably have an article about this later today. :-)

Cheers,

David
--
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.")
Re: WIDGET_LABEL query. [message #61269 is a reply to message #61267] Thu, 10 July 2008 01:44 Go to previous message
biophys is currently offline  biophys
Messages: 68
Registered: July 2004
Member
The label widget does not seem to understand embedded formatting.
However, I found the string() function very helpful. The following
code works for me.:)

mylabel="1stline"+string(byte(13))+"2ndline"
widget_control, label_id, set_value=mylabel

cheers,
bp

On Jul 9, 11:42 pm, Gaurav <selfishgau...@gmail.com> wrote:
> Hi all,
>
> Is it really (I mean really REAL, VERIFIABLE, UNDENIABLE etc.) true
> that one cannot accomodate more than one line of text on a
> WIDGET_LABEL. Curiously, I never had the use to put multiple line of
> text on a label ere now. Today I did, and I was surprized to learn
> that it is not so (newline characters do not work).
>
> So, what does one do when one needs to display information on a base
> that may span many number of lines. I could have multiple labels, but
> then I do not always know how many lines I am going to need. I could
> do that in a WIDGET_TEXT with the sensitivity turned off: but that
> would not quite look like a label does(or does not-for that matter). I
> mean, what is the point of having a large label? Just to put text in
> large fonts? I found a very old post(dated sometime in 1996)
> confirming this inability.
>
> I would like to hear confirmation from the present day gods of IDL
> that things have not changed since. I would also love to hear from the
> powers-that-be at IDL if they can condescend and vouchsafe this
> feature for WIDGET_LABEL.Or is there a workaround, like I have always
> found from the very helpful people in this group.
>
> Thanking you,
> Gaurav
>
> Or is there a workaround, like I have always found from the very
> helpful people in this group.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Random windows VM errors
Next Topic: Re: animated iplots

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

Current Time: Wed Oct 08 13:54:28 PDT 2025

Total time taken to generate the page: 0.00771 seconds