Tkinter: Distinguishing different

Tim Daneliuk tundra at tundraware.com
Fri Dec 27 19:40:07 EST 2002


I have an existing program that binds a feature to:

         <Control-Double-ButtonRelease3>

I now want to add a new feature which binds to:

         <ButtonRelease-3>

The problem is that the handler for the second is always called even
when I am pressing the key combination for the first. Obviously, the
"ButtonRelease-2" is checked by the message dispatcher before the
Control ... combination is checked.

So, how do I actually tell which event is taking place and force Tkinter
to do the right thing? Do I have to write a single handler for all
ButtonRelease-2 events and then check to see if other keys like Control
are also pressed therein? If so, I am unclear how to do this check.

I would actually prefer an approach which caused Tkinter itself to
properly route the event to its associated handler. I allow my users to
rebind keys to features at program startup - i.e. I cannot depend on a
particular key being bound to a particular program feature.

This is all probably real obvious to you Master GUI Designer types out
there, but it puzzles my old command line brain...

TIA,

-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com




More information about the Python-list mailing list