widget_text set_value problem [message #18105] |
Mon, 29 November 1999 00:00 |
p3qa3
Messages: 4 Registered: November 1999
|
Junior Member |
|
|
Hi all,
I want to set a value for a text widget. In my small example this is a
strarr. I would like to make the widget displaying each string in the
array in a separate line.
<--------------- SNIP --------------->
> myValue=('first_line','second_line','third_line')
> wid_ID=widget_base()
> wid_text_ID=widget_text(wid_ID,value=myValue,xsize=200,ysize =10)
> widget_control,wid_ID,/realize
<--------------- SNAP --------------->
The widget shows the contents of the array in ONE line without newlines.
I tried:
a) using keywords on widget creation:
/NO_NEWLINE
/WRAP
.... no change.
b) creating a string that contains '\n' (string(10b))
<--------------- SNIP --------------->
> first_line='My first line'
> separator=string(10b)
> lines=string(first_line,separator,'My second line')
> widget_control,wid_text_ID,set_value=lines
<--------------- SNIP --------------->
Now the text widget displays:
'My first line|My second line' still in one line.
> print,lines
results in the correct output.
If I use
> widget_info,wid_text_ID,get_value=myTestValue
myTestValue contains a strarr(1), whatever the size of the original
strarr
was that has been used for the widget creation.
Any suggestions/comments appreciated !!
Regards, Frank
Sent via Deja.com http://www.deja.com/
Before you buy.
|
|
|