in reply to Re: Re: Tk Scrolled textbox, parse on input?
in thread Tk Scrolled textbox, parse on input?

$_ is not the same as $_[1]. See perlvar for the complete details. In this instance, $_[1] contains the key that was released and $_ truly is uninitialized. However, neither $_ nor $_[1] are going to help you do what you want.

Look instead to the Tk documentation for the get widget method. It will allow you to "get" the text from the scrolled text widget. (Oh and you'll have to fix the logic for your tag coloring to work with multiple lines.)

Good luck!

Replies are listed 'Best First'.
Re: Re: Re: Re: Tk Scrolled textbox, parse on input?
by pg (Canon) on Dec 08, 2003 at 06:19 UTC

    You said something I wanted to say. When replies from other monks give one quick remedies, it is always a good idea to read document on one's own to get the big picture and a deeper understanding.

    In this case, I would add two documents in addition to what you have just mentioned: callbacks and bind under Tk.

Re: Re: Re: Re: Tk Scrolled textbox, parse on input?
by Elijah (Hermit) on Dec 08, 2003 at 14:21 UTC
    I know I will have to re-work the logic for multiple lines but it has to work with one line before it can work on multiple lines. Once I get it the way I want it on one line it will be easy to convert the code to support multiple lines. I was aware of the get() method but wanted to try and avoid this seeing how if the source code being worked on is a few hundred lines or so I will be calling get on the entire textfield every time a new character is entered. This could cause serious performance issues down the road. Maybe a get("1.0:, "lineend") will be better than a get("1.0", "end"). I have tried the lineend before but it has never worked. Maybe I should revisit it.