GrandFather has asked for the wisdom of the Perl Monks concerning the following question:
In a recent SoPW I learned how to resolve a bind related problem in a simple example script by using bindtags. However in the actual code I am using a Scrolled tText widget and the bindtags applies to the Scrolled widget rather than the Text widget. How do I get to the actual Text widget to fix the bindtags order on it?
use strict; use warnings; use Tk; my $mw = MainWindow->new (-title => "PerlMonks node editor"); my $text = $mw->Scrolled ('Text', -font => 'normal', -wrap => 'word', -scrollbars => 'e',); $text->pack (-expand => 'yes', -fill => 'both'); $text->bindtags ([$text, ref($text), $text->toplevel, 'all']); $text->bind ('<Control i>', [\&keyCommand, 'italic']); MainLoop (); sub keyCommand { print "Got Control i\n"; Tk->break; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting bindtags for a Scrolled Tk widget
by vkon (Curate) on Apr 25, 2006 at 07:51 UTC | |
by GrandFather (Saint) on Apr 25, 2006 at 10:16 UTC |