Package autodesk_toxik :: Module ui
[frames] | no frames]

Module ui

User Interface module.

This module provides convenience functions and a {Dialog} class to create dialogs that have the Composite look and feel.

This module also provides access to the current workspace of the Composite application when imported in the embedded Python interpreter.

UI Convenience Functions

The functions in this series create a top level window and a root container (if needed), then create a dialog box and bring it up.

When the dialog is dismissed by the user, the function returns a dictionary of values for all significant widgets. The key is the name of the widget and the value represents the state or data stored by the widget.

In addition to the widgets explicitely created by the caller, there is a key "CloseButtonClicked". The value of this key is the name of the push button that was clicked to close the dialog.

Note: If one wishes to create and launch a Dialog with more control over the widgets in the dialog, such as adding callback functions, please refer to the section on the Dialog class.

Widgets for which data is returned are:

Classes
  Cursor
Functions
 
showOkCancelMessageBox(title, msg, cancelButton=True)
Pops-up a message box with an OK button and optionally a Cancel button.
Function Details

showOkCancelMessageBox(title, msg, cancelButton=True)

 

Pops-up a message box with an OK button and optionally a Cancel button. If the Cancel button is clicked, sys.exit(0) is invoked and the current script execution terminates.

Parameters:
  • title (str) - Message box title.
  • msg (str or list of str) - Message multi-line text which can either be a list of strings or a single string contaning newline characters.