GrandFather has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to provide a default set of tags for characters that are inserted into a Tk::Text widget?
I know that a list of tags can be provided using $text->insert(index, chars, ?tagList, chars, tagList, ...?), but what I want to achieve is applying tags to characters as they are entered from the keyboard. I guess I could do it with a callback bound to the Button event and 'manually' insert the characters at the current insertion point. That seems a bit hands on though.
Update: it turns out part of the problem is that Tk::TextUndo breaks Tk:Text's behaviour whereby characters that are inserted acquire the attributes of the character to the left of the insertion point. It is this problem that I am trying to fix. An option is just to use the Tk::Text widget and forgo the undo provided by Tk::TextUndo.
Update: a bug report has been filed on rt.cpan.org for this problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Providing default tags for characters inserted into a Tk::Text widget
by zentara (Cardinal) on Apr 06, 2006 at 12:46 UTC |