Listbox binding problem 
Author Message
 Listbox binding problem

Hi.

I'm new at perl/tk and was hoping someone could shed some light on this
problem.

I'm running perl/tk under windows 95.

I was having trouble binding KeyPress entries to a listbox.  I was able to
bind mouse clicks but not keypress entries.  Modifying listbox.pm had no
positive effects and then I realized that the default KeyPress bindings
were not being initiated either.  It's seems as if the listbox is blind to
the keyboard.  

Is this a general problem under windows or have I found something special?

--Paul

--
Paul Fisher



Mon, 18 Sep 2000 03:00:00 GMT  
 Listbox binding problem


: Hi.
:
: I'm new at perl/tk and was hoping someone could shed some light on this
: problem.
:
: I'm running perl/tk under windows 95.
:
: I was having trouble binding KeyPress entries to a listbox.  I was able to
: bind mouse clicks but not keypress entries.  Modifying listbox.pm had no
: positive effects and then I realized that the default KeyPress bindings
: were not being initiated either.  It's seems as if the listbox is blind to
: the keyboard.  
:
: Is this a general problem under windows or have I found something special?
:
: --Paul
:
:
:
: --
: Paul Fisher

        Try these, I have found them to be useful. This makes pressing <ENTER>
        on an item behave as if it was clicked.  A separate action is
        defined for doublle-clicking:

        $fieldList->bind('<ButtonRelease>' => [\&fieldClickFn]);
        $fieldList->bind('<Return>'        => [\&fieldClickFn]);

        ...

sub fieldClickFn
{
        my ($myfield) = $fieldList->get('active');  #VALUE OF SELECTED ITEM.
        ...

Quote:
}

        Hope this helps!
        Jim Turner


Mon, 18 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. bind Ev problem with listbox widget

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

3. listbox default bindings

4. Key Bindings for Listbox

5. Key Bindings for Listbox

6. Listbox-Bind question

7. HList with Listbox-like bindings

8. binding <Key> to Listbox

9. Help for listbox->bind() needed

10. bind to listbox selection

11. simple listbox with binding question

12. Bind to Listbox

 

 
Powered by phpBB® Forum Software