Panel.WorkbenchClass

Fields

Name

Type

Access

Description

activate

object

r

parent_class

Gtk.WindowGroupClass

r

unload_async

object

r

unload_finish

object

r

Methods

install_action (action_name, parameter_type, activate)

install_property_action (action_name, property_name)

Details

class Panel.WorkbenchClass
install_action(action_name, parameter_type, activate)
Parameters:
  • action_name (str) – a prefixed action name, such as “project.open”

  • parameter_type (str or None) – the parameter type

  • activate (Panel.ActionActivateFunc) – callback to use when the action is activated

This should be called at class initialization time to specify actions to be added for all instances of this class.

Actions installed by this function are stateless. The only state they have is whether they are enabled or not.

install_property_action(action_name, property_name)
Parameters:
  • action_name (str) – name of the action

  • property_name (str) – name of the property in instances of self or any parent class.

Installs an action called action_name on self and binds its state to the value of the property_name property.

This function will perform a few santity checks on the property selected via property_name. Namely, the property must exist, must be readable, writable and must not be construct-only. There are also restrictions on the type of the given property, it must be boolean, int, unsigned int, double or string. If any of these conditions are not met, a critical warning will be printed and no action will be added.

The state type of the action matches the property type.

If the property is boolean, the action will have no parameter and toggle the property value. Otherwise, the action will have a parameter of the same type as the property.

New in version 1.4.