| Re: Text Widget Confession [message #26726 is a reply to message #26626] |
Tue, 25 September 2001 10:33   |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
David Fanning wrote:
>
> Oh, I don't think so. :-(
>
> In fact, this may be worse.
> But keep working.
I am sorry. I forgot there some inferior platforms are confused about
all the CR-LF and such...
The following Beta 2.02.0001-20010925-b has been tested on Mac, W2K and
HP-UX. Sorry, I am out of platforms. Besides, it is backwards compatible
with IDL 5.3 now. Other requests?
;****************
PRO Example_Event, event
Widget_Control, event.top, Get_UValue=textID
Widget_Control, textID, Get_Value=selectText, /Use_Text_Select
Widget_Control, textID, Get_Value=theText
; Added line
loc = Widget_Info(textID, /Text_Select)
loc = loc[0] - loc[1]*(!version.os_family eq 'Windows')
; End added line
jt = strjoin(thetext, string(1b))
js = strjoin(selecttext, string(1b))
rs = jt
; Modified line
strput, rs, string( byte(js) < 2b), strpos(jt, js, loc)
; End modified line
good_rows = where(strsplit(rs, string(1b), /extract) $
eq theText, count)
if count ne 0 then theText = theText[good_rows]
Widget_Control, textID, Set_Value=theText
END; -----------------------------------;****************
Cheers,
Pavel
|
|
|
|