[issue11387] Tkinter, callback functions

Serhiy Storchaka report at bugs.python.org
Mon Jun 2 08:11:36 CEST 2014


Serhiy Storchaka added the comment:

This is not Tkinter bug, this is normal Tk behavior. Here is minimal reproducer on Tcl/Tk :

    button .b -text "Click me"
    bind .b <Button-1> {tk_messageBox -message "The button is sunken!"}
    pack .b

I suppose the button is left sunken because the message box steals a focus.

In general binding mouse click event for button is not a good idea, because it makes a button non-usable with keyboard. Use the "command" option.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11387>
_______________________________________


More information about the Python-bugs-list mailing list