Button

The value type Button is used to create a button.

../../../../_images/Button.png

Syntax

<Parameter>
<Name>ButtonRow</Name>
<Text>Button</Text>
<ValueType>Row</ValueType>
<Parameter>
<Name>Button</Name>
<Text>ButtonText</Text>
<EventId>1000</EventId>
<ValueType>Button</ValueType>
</Parameter>
</Parameter>

The button must be included in a Row, because there are two texts needed. One as description text on the left side and one for the tooltip text.

After clicking the button, the value of <EventId> can be processed by the function on_control_event in the PythonPart script (.py) file.

If the value of the <Text> tag is too long, only the end of the text will be displayed in the button. The whole text is displayed as a tooltip on the button.

Optional tags

If the PythonPart should be localized, the following tag must be added

<TextId>1001</TextId>

Sometimes it’s useful to disable or hide the button depending on the value of another parameter. This is achieved by adding additional tags to the parameter or by defining functions in the py-file. See Enable and visible options

Example

The implementation of the Button value type is described in the example Button, which is located in

…\etc\Examples\PythonParts\PaletteExamples\Button.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\Button.py