Reposting this midweek, just in case it makes a difference...

I'm writing a Tk script and have a little question:

I want to be able to use the 'Del' key to delete an entry in the
following listbox:

     $forms_box = $forms_menu_middle->ScrlListbox(-label => "$choices
entered",
         -height => 15,
         -selectmode=>"browse")->pack(-side => "left");

I tried the following, but with no success:

     $forms_box->bind("<Key-Delete>", sub {
         $forms_box->delete("active");
         });

....even though the same sub in a button works:

     $forms_menu_middle->Button(-text => "Delete $choice",
         -command => sub {$forms_box->delete("active");},
         -relief => "raised")->pack(-side => "right");

I've managed to get "<Key-Delete>" working in an Entry widget, and I've
tried more basic commands in the sub, namely {print "help";}, but the
sub doesn't appear to be invoked at all.  The only thing I can think of
is that the ScrlListbox widget doesn't accept key bindings, but I can
find no mention of it in the docs.  Any thoughts?

Thanks in advance and keep up the good work.

Damian.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to