Binding Tkinter Events
This example shows how you can use a new capability in PySimpleGUI.... the ability to create custom events that will be returned to you through your call to
In this case, the desired events are when a window receives and loses focus. This is an advanced capability that most applications don't need, but it's nice to know it's available should you need it.
The same kind of constructions can be used to bind right clicks to buttons for example.