Re: Text Widget Confession [message #26767 is a reply to message #26626] |
Fri, 21 September 2001 11:19   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes:
> 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
> jt = strjoin(thetext, string(1b))
> js = strjoin(selecttext, string(1b))
> rs = jt
> strput, rs, string( byte(js) < 2b), strpos(jt, js)
> print, where(strsplit(rs, string(1b), /extract) ne thetext)
> END; -----------------------------------
Duh! How come I didn't think of that!?
Cheers,
David
P.S. Let's just say the only thing that confuses me
more than how text widgets work is string manipulation. :-(
I'll give Pavel credit, though. He's done it!
I did learn one new thing today, though. I eventually
went to a multiple selection list widget, which--of course--
returns an array of the text indices I *don't* want. I want
the inverse of this. So I found a fabulous SetDifference
function on that Coyote site that allowed me to fix my
text array in one line. Neat! :-)
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|