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

Re: bind up and down keys in a tk listbox

by reasonablekeith (Deacon)
on Mar 02, 2007 at 15:01 UTC ( #602886=note: print w/replies, xml ) Need Help??


in reply to bind up and down keys in a tk listbox

If you want the up/down keys to control the listbox then I think you need to manage the focus. Adding an explict call in your code as follows enables these keys.
foreach my $key ("a" , "b" , "c") { $lb -> insert( 'end', $key ); } $lb->activate ( 0 ) ; $lb->selectionSet ( 0 ) ; $lb->focus();
I'm _far_ from being a Tk expert, so I'd advise you to check out Tk::Focus docs for yourself.
---
my name's not Keith, and I'm not reasonable.

Replies are listed 'Best First'.
Re^2: bind up and down keys in a tk listbox
by lepetitalbert (Abbot) on Mar 02, 2007 at 15:13 UTC

    Thank you reasonablekeith, cannot belive I missed this :)

    Works perfect.

    Have a nice day.

    "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-12-03 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?