ROOT
master
Reference Guide
Loading...
Searching...
No Matches
_tqobject.pyzdoc
Go to the documentation of this file.
1
/**
2
\pythondoc TQObject
3
4
The `Connect` method of TQObject (and thus of any class deriving from it, like
5
the GUI widgets) directly accepts a Python callable as the slot:
6
7
\code{.py}
8
import ROOT
9
10
def on_clicked():
11
print("button clicked")
12
13
button = ROOT.TGTextButton(parent, "&Draw", 10)
14
button.Connect("Clicked()", on_clicked)
15
\endcode
16
17
The arguments emitted by the signal are forwarded to the callable, as far as
18
its signature accepts them. The connection keeps the callable alive; it can be
19
undone with `Disconnect`, passing the same signal and callable:
20
21
\code{.py}
22
button.Disconnect("Clicked()", on_clicked)
23
\endcode
24
25
The C++ signature `Connect(signal, receiver_class, receiver, slot)` remains
26
available.
27
28
\endpythondoc
29
*/
pyzdoc
_tqobject.pyzdoc
ROOTmaster - Reference Guide Generated on Thu Aug 27 2026 18:34:04 (GVA Time) using Doxygen 1.10.0