Panel.Widget

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Panel.Widget Panel.Widget Gtk.Widget->Panel.Widget

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Panel.WidgetClass (2), Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

install_action (action_name, parameter_type, activate)

class

install_property_action (action_name, property_name)

class

new ()

action_set_enabled (action_name, enabled)

close ()

focus_default ()

force_close ()

get_busy ()

get_can_maximize ()

get_child ()

get_default_focus ()

get_icon ()

get_icon_name ()

get_id ()

get_kind ()

get_menu_model ()

get_modified ()

get_needs_attention ()

get_position ()

get_reorderable ()

get_save_delegate ()

get_title ()

get_tooltip ()

insert_action_group (prefix, group)

mark_busy ()

maximize ()

raise_ ()

set_can_maximize (can_maximize)

set_child (child)

set_icon (icon)

set_icon_name (icon_name)

set_id (id)

set_kind (kind)

set_menu_model (menu_model)

set_modified (modified)

set_needs_attention (needs_attention)

set_reorderable (reorderable)

set_save_delegate (save_delegate)

set_title (title)

set_tooltip (tooltip)

unmark_busy ()

unmaximize ()

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

do_get_default_focus ()

do_presented ()

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

busy

bool

r

If the widget is busy, such as loading or saving a file

can-maximize

bool

r/w/en

Can Maximize

child

Gtk.Widget

r/w/en

Child

icon

Gio.Icon

r/w/en

A Gio.Icon for the panel

icon-name

str

r/w/en

Icon Name

id

str

r/w/en

The identifier for the widget which can be used for saving state

kind

str

r/w/en

The kind of panel widget

menu-model

Gio.MenuModel

r/w/en

Menu Model

modified

bool

r/w/en

If the widget contains unsaved state

needs-attention

bool

r/w/en

Needs Attention

reorderable

bool

r/w/en

If the panel may be reordered

save-delegate

Panel.SaveDelegate

r/w/en

A save delegate to perform a save operation on the page

title

str

r/w/en

Title

tooltip

str

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

get-default-focus

Gets the default widget to focus within the Panel.Widget.

presented

The “presented” signal is emitted when the widget is brought to the front of a frame.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class Panel.Widget(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Panel.WidgetClass

Panel.Widget is the base widget class for widgets added to a Panel.Frame. It can be use as-is or you can subclass it.

classmethod install_action(action_name, parameter_type, activate)
Parameters:
  • action_name (str) – a prefixed action name, such as “clipboard.paste”

  • parameter_type (str or None) – the parameter type

  • activate (Gtk.WidgetActionActivateFunc) – 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.

classmethod new()
Returns:

a newly created Panel.Widget

Return type:

Gtk.Widget

Create a new Panel.Widget.

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

  • enabled (bool) –

close()
focus_default()
Return type:

bool

force_close()

Closes the widget without any save dialogs.

get_busy()
Return type:

bool

get_can_maximize()
Return type:

bool

get_child()
Returns:

a Gtk.Widget or None

Return type:

Gtk.Widget or None

Gets the child widget of the panel.

get_default_focus()
Returns:

the default widget to focus within the Panel.Widget.

Return type:

Gtk.Widget or None

Discovers the widget that should be focused as the default widget for the Panel.Widget.

For example, if you want to focus a text editor by default, you might return the Gtk.TextView inside your widgetry.

get_icon()
Returns:

a Gio.Icon or None

Return type:

Gio.Icon or None

Gets a Gio.Icon for the widget.

get_icon_name()
Returns:

the icon name or None

Return type:

str or None

Gets the icon name for the widget.

get_id()
Returns:

The id of the panel widget.

Return type:

str

Gets the id of the panel widget.

get_kind()
Return type:

str

get_menu_model()
Returns:

a Gio.MenuModel

Return type:

Gio.MenuModel or None

Gets the Gio.MenuModel for the widget.

Panel.FrameHeader may use this model to display additional options for the page to the user via menus.

get_modified()
Returns:

the modified status of the panel widget.

Return type:

bool

Gets the modified status of a panel widget

get_needs_attention()
Return type:

bool

get_position()
Returns:

a Panel.Position or None if the widget isn’t within a Panel.Frame.

Return type:

Panel.Position or None

Gets teh position of the widget within the dock.

get_reorderable()
Return type:

bool

get_save_delegate()
Returns:

a Panel.SaveDelegate or None

Return type:

Panel.SaveDelegate or None

Gets the Panel.Widget :save-delegate property.

The save delegate may be used to perform save operations on the content within the widget.

Document editors might use this to save the file to disk.

get_title()
Returns:

the title or None

Return type:

str or None

Gets the title for the widget.

get_tooltip()
Returns:

the tooltip or None

Return type:

str or None

Gets the tooltip for the widget.

insert_action_group(prefix, group)
Parameters:
mark_busy()
maximize()
raise_()
set_can_maximize(can_maximize)
Parameters:

can_maximize (bool) –

set_child(child)
Parameters:

child (Gtk.Widget or None) – a Gtk.Widget or None

Sets the child widget of the panel.

set_icon(icon)
Parameters:

icon (Gio.Icon or None) – a Gio.Icon or None

Sets a Gio.Icon for the widget.

set_icon_name(icon_name)
Parameters:

icon_name (str or None) – the icon name or None

Sets the icon name for the widget.

set_id(id)
Parameters:

id (str) – the id to set for the panel widget.

Sets the id of the panel widget.

set_kind(kind)
Parameters:

kind (str or None) – the kind of this widget

Sets the kind of the widget.

set_menu_model(menu_model)
Parameters:

menu_model (Gio.MenuModel or None) – a Gio.MenuModel

Sets the Gio.MenuModel for the widget.

Panel.FrameHeader may use this model to display additional options for the page to the user via menus.

set_modified(modified)
Parameters:

modified (bool) – the modified status

Sets the modified status of a panel widget.

set_needs_attention(needs_attention)
Parameters:

needs_attention (bool) –

set_reorderable(reorderable)
Parameters:

reorderable (bool) –

set_save_delegate(save_delegate)
Parameters:

save_delegate (Panel.SaveDelegate or None) – a Panel.SaveDelegate or None

Sets the Panel.Widget :save-delegate property.

The save delegate may be used to perform save operations on the content within the widget.

Document editors might use this to save the file to disk.

set_title(title)
Parameters:

title (str or None) – the title or None

Sets the title for the widget.

set_tooltip(tooltip)
Parameters:

tooltip (str or None) – the tooltip or None

Sets the tooltip for the widget to be displayed in tabs.

unmark_busy()
unmaximize()
do_get_default_focus() virtual
Returns:

the default widget to focus within the Panel.Widget.

Return type:

Gtk.Widget or None

Discovers the widget that should be focused as the default widget for the Panel.Widget.

For example, if you want to focus a text editor by default, you might return the Gtk.TextView inside your widgetry.

do_presented() virtual

Signal Details

Panel.Widget.signals.get_default_focus(widget)
Signal Name:

get-default-focus

Flags:

RUN_LAST

Parameters:

widget (Panel.Widget) – The object which received the signal

Returns:

a Gtk.Widget within Panel.Widget or None.

Return type:

Gtk.Widget or None

Gets the default widget to focus within the Panel.Widget. The first handler for this signal is expected to return a widget, or None if there is nothing to focus.

Panel.Widget.signals.presented(widget)
Signal Name:

presented

Flags:

RUN_LAST

Parameters:

widget (Panel.Widget) – The object which received the signal

The “presented” signal is emitted when the widget is brought to the front of a frame.

Property Details

Panel.Widget.props.busy
Name:

busy

Type:

bool

Default Value:

False

Flags:

READABLE

If the widget is busy, such as loading or saving a file

Panel.Widget.props.can_maximize
Name:

can-maximize

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Can Maximize

Panel.Widget.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child inside this widget.

Panel.Widget.props.icon
Name:

icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The icon for this widget.

Panel.Widget.props.icon_name
Name:

icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The icon name for this widget.

Panel.Widget.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The identifier for the widget which can be used for saving state

Panel.Widget.props.kind
Name:

kind

Type:

str

Default Value:

'unknown'

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The kind of panel widget

Panel.Widget.props.menu_model
Name:

menu-model

Type:

Gio.MenuModel

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A menu model to display additional options for the page to the user via menus.

Panel.Widget.props.modified
Name:

modified

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If the widget contains unsaved state

Panel.Widget.props.needs_attention
Name:

needs-attention

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Needs Attention

Panel.Widget.props.reorderable
Name:

reorderable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If the panel may be reordered

Panel.Widget.props.save_delegate
Name:

save-delegate

Type:

Panel.SaveDelegate

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The save delegate attached to this widget.

Panel.Widget.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The title for this widget.

Panel.Widget.props.tooltip
Name:

tooltip

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The tooltip to display in tabs for the widget.

New in version 1.2.