in reply to emulate Tk button push

You can use the -underline option to make the button have an underline under the character that you want for the keybinding. For instance if $button's -text => 'Yes' then you could say -underline=> 0 to underline the Y (the 0th character...)

Then you could just map the keypress event to the same sub that is executed when the button is clicked by using:

$mw->bind('<KeyPress-Y>' => \&button_sub);

To make Y execute the same sub as the button...

---mmmmtmmmm

Replies are listed 'Best First'.
Re^2: emulate Tk button push
by spx2 (Deacon) on Sep 19, 2007 at 09:22 UTC

    I thought of that method but the problem is,I have a big table,and in certain columns there are buttons. Ammounting to at least 80 buttons,so if I would make keybindings like that , I would need 80 key-combinations. So I want to key bind some sub that would find the row I'm on and then send an similar-WM_COMMND(push event) to the specific button on that row.

      find the row I'm on

      how do you define "the row I'm on"? Are there other widgets in the row which might have focus? What else are you not telling us?

        I've found a way to take the row I'm on. It's a very very very very intuitive expression. It's the row of the active cell and I've taken it with  TableMatrix->index('active') =~ /(\d+),/ ; Yes there are other widgets on the row,there are some columns wich contain each one button(as I have specified already above).