Re: Text Widget Confession [message #26736 is a reply to message #26626] |
Mon, 24 September 2001 12:46   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Don J Lindler (lindler@rockit.gsfc.nasa.gov) writes:
> I have not run the code, but it looks to me that if your text widget had
> something like:
>
> hog
> dog
> dig
>
> and you selected the og from dog and the d from dig. The code would select
> the og from hog and the d from dog. The strpos would find the first
> occurence of the string.
W-A-A-I-I-T, don't cash that check!!!
Humm. Alright. In the actual application there
is probably a very small chance something like this
could happen, but it is not impossible.
The code is simple enough, I'll make it available
for anyone who wants to have a go at solving this
problem. You can find it here:
ftp://ftp.dfanning.com/pub/dfanning/outgoing/misc/recorder__ define.pro
You will get it running like this:
IDL> o = obj_new('recorder', text=['pig','dog','cow','pig','coyote'])
IDL> o->gui
You can add text to it like this:
IDL> o->AddText, 'rooster'
The code you want to fool around with is in the object
method named Recorder::DeleteIt.
So many people are involved now I should offer a prize.
OK, First Prize is Liam's book, Last Prize is my book. :-(
Cheers,
David
--
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
|
|
|