Panel.Workbench

g GObject.Object GObject.Object Gtk.WindowGroup Gtk.WindowGroup GObject.Object->Gtk.WindowGroup Panel.Workbench Panel.Workbench Gtk.WindowGroup->Panel.Workbench

Subclasses:

None

Methods

Inherited:

Gtk.WindowGroup (4), GObject.Object (37)

Structs:

Panel.WorkbenchClass (2), GObject.ObjectClass (5)

class

find_from_widget (widget)

class

install_action (action_name, parameter_type, activate)

class

install_property_action (action_name, property_name)

class

new ()

action_set_enabled (action_name, enabled)

activate ()

add_workspace (workspace)

find_workspace_typed (workspace_type)

focus_workspace (workspace)

foreach_workspace (foreach_func, *foreach_func_data)

get_id ()

remove_workspace (workspace)

set_id (id)

Virtual Methods

Inherited:

GObject.Object (7)

do_activate ()

do_unload_async (cancellable, callback, *user_data)

do_unload_finish (result)

Properties

Name

Type

Flags

Short Description

id

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Name

Short Description

activate

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.WindowGroup

r

Class Details

class Panel.Workbench(**kwargs)
Bases:

Gtk.WindowGroup

Abstract:

No

Structure:

Panel.WorkbenchClass

classmethod find_from_widget(widget)
Parameters:

widget (Gtk.Widget) – a Gtk.Widget

Returns:

a Panel.Workbench or None

Return type:

Panel.Workbench or None

Finds the workbench that contains widget.

New in version 1.4.

classmethod 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.

classmethod 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.

classmethod new()
Return type:

Panel.Workbench

action_set_enabled(action_name, enabled)
Parameters:
  • action_name (str) –

  • enabled (bool) –

activate()
add_workspace(workspace)
Parameters:

workspace (Panel.Workspace) –

find_workspace_typed(workspace_type)
Parameters:

workspace_type (GObject.GType) –

Returns:

a Panel.Workspace or None

Return type:

Panel.Workspace or None

Locates a workspace in self with a type matching type.

New in version 1.4.

focus_workspace(workspace)
Parameters:

workspace (Panel.Workspace) –

foreach_workspace(foreach_func, *foreach_func_data)
Parameters:

Calls foreach_func for each workspace in the workbench.

New in version 1.4.

get_id()
Return type:

str

remove_workspace(workspace)
Parameters:

workspace (Panel.Workspace) –

set_id(id)
Parameters:

id (str) –

do_activate() virtual
do_unload_async(cancellable, callback, *user_data) virtual
Parameters:
do_unload_finish(result) virtual
Parameters:

result (Gio.AsyncResult) –

Return type:

bool

Signal Details

Panel.Workbench.signals.activate(workbench)
Signal Name:

activate

Flags:

RUN_LAST

Parameters:

workbench (Panel.Workbench) – The object which received the signal

Property Details

Panel.Workbench.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The “id” of the workbench.

This is generally used by applications to help destinguish between projects, so that the project-id matches the workbench-id.

New in version 1.4.