Debian Codegraph @

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

raw
1 cgen : creates a list entry useful to generate list of arbitrary values
2 =======================================================================
3
4 Initline
5 ---------
6
7 .. code::
8
9 cgen(name='gen', label='Wave shape', init=[1,0,.3,0,.2,0,.143,0,.111],
10 rate='k', popup=None, col='red', help='')
11
12 Description
13 ------------
14
15 Widget that can be used to create a list of floating-point values. A
16 left click on the widget will open a floating window to enter the desired
17 values. Values can be separated by commas or by spaces.
18
19 If `rate` argument is set to 'i', a built-in reserved variable is created
20 at initialization time. The variable name is constructed like this :
21
22
23 .. code::
24
25 self.widget_name + '_value' for retrieving a list of floats.
26
27 If `name` is set to 'foo', the variable name will be:
28
29
30 .. code::
31
32 self.foo_value (this variable is a list of floats)
33
34 If `rate` argument is set to 'k', a module method using one argument
35 must be defined with the name `name`. If `name` is set to 'foo', the
36 function should be defined like this :
37
38
39 .. code::
40
41 def foo(self, value):
42 value -> list of strings
43
44 Parameters
45 -----------
46
47 **name**: str
48 Name of the widget.
49 Used to defined the function or the reserved variable.
50 **label**: str
51 Label shown in the interface.
52 **init**: int
53 An array of number, separated with commas, with which to
54 initialize the widget.
55 **rate**: str {'k', 'i'}
56 Indicates if the widget is handled at initialization time only
57 ('i') with a reserved variable or with a function ('k') that can
58 be called at any time during playback.
59 **popup**: tuple (str, int) -> (popup's name, index)
60 If a tuple is specified, and cgen is modified, the popup will
61 be automatically set to the given index.
62 **col**: str
63 Color of the widget.
64 **help**: str
65 Help string shown in the widget's tooltip.
66
67