Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Tk Text widget & key bindings

by lamprecht (Friar)
on Apr 20, 2011 at 20:34 UTC ( [id://900420]=note: print w/replies, xml ) Need Help??


in reply to Tk Text widget & key bindings

Your text widget needs focus to receive key events. Configure  -takefocus => 1 or give it focus calling  $text->focus().

Cheers, Christoph
use warnings; use strict; use Tk; my $t=tkinit->Text(-state => 'disabled', -takefocus =>1, # tab-key moves focus )->pack; $t->bind('<Any-Key>'=>sub { print "received Key\n"; }); $t->focus; #init focus MainLoop;

Replies are listed 'Best First'.
Re^2: Tk Text widget & key bindings
by brian42miller (Sexton) on Apr 21, 2011 at 19:09 UTC
    Yes, thank you, that did the trick. Greatly appreciate the help! Brian

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2026-04-21 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.