Re: WIDGET_LABEL query. [message #61239] |
Thu, 10 July 2008 09:48  |
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.")
|
|
|