TermTk.TTkCore.signal
Signals & Slots [Tutorial]
Signals and slots are used for communication between objects.
Intro
The
TermTk.TTkCore.signal
is more than heavily inspired by Qt5 Signal&SlotsIn GUI programming, when we change one widget, we often want another widget to be notified.
More generally, we want objects of any kind to be able to communicate with one another.
For example, if a user clicks a Close button, we probably want the window’s close() function to be called.
Signal and Slots
A signal is emitted when a particular event occurs.
A slot is a function that is called in response to a particular signal.
TermTk’s
TTkWidgets
have many predefined signals/slots, but it is possible to subclass any TTkWidgets
and add our own signals/slots to them.