Skip to content

Use the task dialog

Gaël Écorchard edited this page Sep 20, 2022 · 1 revision

See the macro Generador3D for an example.

Procedure:

  • Define a class implementing the function accept, let's call it MacroPanel
  • call gui.Control.showDialog(MacroPanel()) after the class definition
  • In MacroPanel.__init__(), load your UI, for example with self.form = gui.PySideUic.loadUi(app.getUserMacroDir(True) + '/my_macro/ui/form.ui'), and connect your callbacks
  • At the end of the function MacroPanel.accept, call gui.Control.closeDialog() if you want to close the dialog on acceptance

TODO, help needed: document how to activate/deactivate the OK button.