UI API

UI API is acccessible through the p3dsdk.ui submodule.

class Application

Creates an application instance.

exec()

Display on screen all the widgets on which show() method was called.

class Orientation
HORIZONTAL

Horizontal orientation.

VERTICAL

Vertical orientation.

class Position
CENTER

Center alignment.

LEFT

Left alignment.

RIGHT

Right alignment.

class Tick

Slider tick position.

NONE

No ticks displayed.

ABOVE

Ticks above or left of the slider.

BELOW

Ticks below or right of the slider.

BOTH

Ticks on both sides.

critical_message_box(title, msg, button_list)

Creates a message box with a critical icon.

Parameters
  • title (str) -- The title of the message box.

  • msg (str) -- The message contained in the message box.

  • button_list (list(str)) -- List of button names that will be displayed on the message box. There is a maximum of three buttons.

Returns

The name of the button that was clicked.

Return type

str

information_message_box(title, msg, button_list)

Creates a message box with an information icon.

Parameters
  • title (str) -- The title of the message box.

  • msg (str) -- The message contained in the message box.

  • button_list (list(str)) -- List of button names that will be displayed on the message box. There is a maximum of three buttons.

Returns

The name of the button that was clicked.

Return type

str

no_icon_message_box(title, msg, button_list)

Creates a message box without icon.

Parameters
  • title (str) -- The title of the message box.

  • msg (str) -- The message contained in the message box.

  • button_list (list(str)) -- List of button names that will be displayed on the message box. There is a maximum of three buttons.

Returns

The name of the button that was clicked.

Return type

str

warning_message_box(title, msg, button_list)

Creates a message box with a warning icon.

Parameters
  • title (str) -- The title of the message box.

  • msg (str) -- The message contained in the message box.

  • button_list (list(str)) -- List of button names that will be displayed on the message box. There is a maximum of three buttons.

Returns

The name of the button that was clicked.

Return type

str

open_directory_selector(dir_name='/')

Shows an open directory selector.

Parameters

dir_name (str) -- The path where the dialog will be open.

Returns

The path of the directory that was selected. If no directory was selected an empty string is returned.

Return type

str

open_file_selector(dir_name='/', filter='')

Shows an open file selector.

Parameters
  • dir_name (str) -- The path where the dialog will be open.

  • filter (str) -- The types of files that will be visible from the dialog.

Returns

The path of the file that was selected. If no file was selected an empty string is returned.

Return type

str

save_file_selector(dir_name)

Shows a saving file selector.

Parameters
  • dir_name (str) -- The path where the dialog will be open.

  • filter (str) -- The types of files that will be visible from the dialog.

Returns

The path of the file that is to be saved. If no file was selected an empty string is returned.

Return type

str