The Button component is an interface element used to execute code that interacts with the application. We typically use it to:
- Run application nodes (for example, run a model or calculation chain).
- Trigger processes such as sending emails or exporting results.
- Save or refresh data and update other components on the screen.
When a user clicks the button, Pyplan executes the action we configured, usually by calling a specific node in the model.
After placing a Button on the interface, we configure it from the Component configuration panel on the right (as shown in the image):
In the General section we define:
- The label of the button (text displayed inside it).
In the Styles section we control its appearance:
- Font size (slider).
- Font style (bold, italic, underline).
- Text alignment (left, center, right, justified).
- Font color and background color.
- Multiline: whether the label can wrap onto multiple lines.
- Uppercase: whether the label text is automatically converted to uppercase.
- Format: layout options such as Full container or other size presets.
- Optional icon to display next to the label.
These options let us adapt the button to match the design of the interface and highlight important actions.
For critical actions—such as running heavy models, overwriting results, or sending notifications—we can enable a confirmation dialog.
When this option is active:
- Clicking the button first opens a confirmation popup instead of executing the action immediately.
- We can define a custom confirmation message, for example:
- “Are you sure you want to run the simulation?”
- “This action will overwrite existing results. Continue?”
- Only if the user confirms (for example, by clicking OK or Confirm) does Pyplan execute the configured action or node.
This extra step helps prevent accidental executions and gives users clear feedback about what the button will do.