in reply to Tk Button Press
The first thing to do is decide exactly what you want to have happen. From the code it isn't clear.
I'm pretty sure you don't want to bind all left clicks everywhere. You probably want to set just the button's command to run a function whenever the button is triggered by any of the normal means not just clicking.
Your function should query the state of the lights if possible, and set them to the opposite state. Otherwise, you'd have to store the previously requested state and request the other state blindly.
|
|---|