batkins has asked for the wisdom of the Perl Monks concerning the following question:
I tried $self->{text}->tagAdd('name of tag', 'insert') but this didn't work. What I ultimately had to do was create a second tag called 'elide' that had the elide attribute set to l and do this:
$self->{text}->insert('insert', '%%IGNORETHIS%%', ['elide', 'name of tag'])So what this did was insert an invisible string at the end of the text which had the appropriate style. When I compine both of these methods together (that is, I add the tag to insert and then print out the dummy text), all characters typed after the style change are displayed with the proper tag.
This doesn't seem very neat to me, though. Is there some better way to do this?
Billedited by ybiC: balanced <code> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing Style on Tk::Text
by bobn (Chaplain) on Aug 20, 2003 at 23:21 UTC |