in reply to Using Perl/Tk text tags
$text->tag('bind','your-tag','<Button-1>'=>sub { my $var = $text->get($text->tagPrevrange('your-tag','current')); # and here do something with $var });
Also, 'widget' program, which comes with Tk distribution, greatly helps to answer similar questions, because it allows you to see a code that implements a behaviour that is currently demonstrated.
update: 'current' is a *mark* and not a tag
Best wishes,
I.R.Baboon.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using Perl/Tk text tags
by Anonymous Monk on Jun 14, 2002 at 17:22 UTC |