Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: tk bindings and readonly?

by converter (Priest)
on Dec 10, 2003 at 23:54 UTC ( #313924=note: print w/ replies, xml ) Need Help??


in reply to Re: tk bindings and readonly?
in thread tk bindings and readonly?

I made a mistake here. When the Text widget has focus, the C-s character is still inserted. After re-reading the docs, it looks like the best approach for an instance binding would be something like:

use Tk; $mw = tkinit; $t1 = $mw->Text->pack; $t1->bind('<Control-s>', sub { print "foo\n\n"; $_[0]->break }); # the order of bindtags is: # class name (Tk::Text), window name, ancestral toplevel, "all" # this modifies the tag list so that the instance binding, # which includes a call to break(), has higher priority # than the class binding $t1->bindtags([($t1->bindtags)[1,0,2,3]]); MainLoop;


Comment on Re: Re: tk bindings and readonly?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://313924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2014-09-23 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (220 votes), past polls