Debian Codegraph @

doc-en/source/src/api/Interface/cbutton.rst

raw
1 cbutton : creates a button that can be used as an event trigger
2 ===============================================================
3
4 Initline
5 ---------
6
7 .. code::
8
9 cbutton(name='button', label='Trigger', col='red', help='')
10
11 Description
12 ------------
13
14 A button has no state, it only sends a trigger when it is clicked.
15
16 When the button is clicked, a function is called with the current
17 state of the mouse (down or up) as argument.
18
19 If `name` is set to 'foo', the function should be defined like this :
20
21
22 .. code::
23
24 def foo(self, value):
25
26 value is True on mouse pressed and False on mouse released.
27
28 Parameters
29 -----------
30
31 **name**: str
32 Name of the widget. Used to defined the function.
33 **label**: str
34 Label shown in the interface.
35 **col**: str
36 Color of the widget.
37 **help**: str
38 Help string shown in the button tooltip.
39
40