Bind to Listbox 
Author Message
 Bind to Listbox

Hi,

is it possible to add a bind to a Listbox which looks at the key typed and tries to find the
appropriate
entry in the list. My code looks like this

$listbox->bind("<KeyPress>", [ \&searchForIt, Ev("K') ] );

but no event is fired. What do I wrong here ?

Regards Uwe

--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Uwe Sauerbrei /

Quote:
>>>"Runtime error in REALITY.SYS - Please reboot universe "<<<



Fri, 23 Aug 2002 03:00:00 GMT  
 Bind to Listbox

Quote:

> Hi,

> is it possible to add a bind to a Listbox which looks at the key typed and tries to find the
> appropriate
> entry in the list. My code looks like this

> $listbox->bind("<KeyPress>", [ \&searchForIt, Ev("K') ] );

> but no event is fired. What do I wrong here ?

You have to set the focus() to the listbox first, either with the tab
key or with the method call.

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s!\n!!g;map{create$c 'line'=>
map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split''}split"!";$x+=12}split/_/=>'K
PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+
KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop



Fri, 23 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. bind to listbox selection

2. non-mouse event binding in Listbox doesn't work?

3. How to bind a scroll bar to more than one listbox

4. bind Ev problem with listbox widget

5. Listbox-Bind question

6. Listbox binding problem

7. binding <Key> to Listbox

8. Help for listbox->bind() needed

9. simple listbox with binding question

10. binding non-X events in listbox

11. Binding Button-1 to Listbox

12. Binding 2 scrolled listboxes to a third.

 

 
Powered by phpBB® Forum Software