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

Home » Public Forums » archive » Re: Newline in widget_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: Newline in widget_text [message #43756] Wed, 27 April 2005 09:22 Go to previous message
kBob is currently offline  kBob
Messages: 3
Registered: April 2005
Junior Member
I have displayed multi-line text in the WIDGET_TEXT using special
characters and/or creating a text array. I find it's important that the
XSIZE and YSIZE are set. See sample IDL code below.

Wish we could do color in the WIDGET_TEXT, but I haven't seen how,
yet.

Kelly Dean
Fort Collins, Colorado

------------------------------------------------------------ -

PRO TryIt_event, event
;
thisevent = TAG_NAMES( event, /STRUCTURE)

CASE thisEvent OF
'WIDGET_BUTTON' : BEGIN
Widget_control,event.top, /Destroy
END
ELSE : BEGIN
PRINT, 'Unknown event ', thisEvent
END
ENDCASE
END
;
;-------------------------------------------
;
PRO TryIT
;
cmdot = STRING([183B]) ; Middle dot
cbullet = STRING([149B]) ; Bullet
ctab = STRING([9B]) ; tab
ccr = STRING(13B) ; Carriage Return
clf = STRING([10B]) ; line feed
;
; Array method
;
txtLine = 'Array Method '
txtArr = txtLine
txtLine = cbullet + Systime()
txtArr = [txtArr, txtLine ]
txtLine = ctab + cmdot + ' I tabbed '
txtArr = [txtArr, txtLine ]
;
; Special characters
;
txtSpl = 'Special Char Method' + ccr + clf
txtSpl = txtSpl + cbullet + Systime() + ccr + clf
txtSpl = txtSpl + ctab + cmdot + ' I tabbed ' + ccr + clf
;
;
wBase = WIDGET_BASE( Title='Text Widget', /Column )
NotUsed = WIDGET_TEXT( wBase, VALUE=txtArr) ; Notice, this doesn't work
Notused = WIDGET_TEXT( wBase, VALUE=txtArr, XSIZE=30, YSIZE=3) ;
Specifing size important
NotUsed = WIDGET_TEXT( wBase, VALUE=txtSpl) ; Notice, this doesn't work
NotUsed = WIDGET_TEXT( wBase, VALUE=txtSpl, XSIZE=30, YSIZE=3) ;
Specifing size important
Notused = WIDGET_BUTTON( wBase, VALUE='Done' )
;
WIDGET_CONTROL, wBase, /REALIZE
XMANAGER, 'TryIt', wBase
;
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Q: call_external hangs IDL Windows GUI?
Next Topic: Re: Strange problems with IDL on my PC (memory allocation and 3d rendering)

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

Current Time: Fri Oct 10 07:27:56 PDT 2025

Total time taken to generate the page: 0.95406 seconds