Gdl.DockItem

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gdl.DockItem Gdl.DockItem Gdl.DockObject Gdl.DockObject Gdl.DockObject->Gdl.DockItem Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gdl.DockObject Gtk.Widget->Gtk.Container

Subclasses:

Gdl.DockNotebook, Gdl.DockPaned

Methods

Inherited:

Gdl.DockObject (34), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gdl.DockItemClass (1), Gdl.DockObjectClass (1), Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (name, long_name, behavior)

class

new_with_pixbuf_icon (name, long_name, pixbuf_icon, behavior)

class

new_with_stock (name, long_name, stock_id, behavior)

class

set_has_grip (has_grip)

bind (dock)

dock_to (target, position, docking_param)

get_behavior_flags ()

get_child ()

get_drag_area (rect)

get_grip ()

get_orientation ()

get_tablabel ()

hide_grip ()

hide_item ()

iconify_item ()

is_closed ()

is_iconified ()

is_placeholder ()

lock ()

notify_deselected ()

notify_selected ()

or_child_has_focus ()

preferred_size (req)

set_behavior_flags (behavior, clear)

set_child (child)

set_default_position (reference)

set_orientation (orientation)

set_tablabel (tablabel)

show_grip ()

show_item ()

unbind ()

unlock ()

unset_behavior_flags (behavior)

Virtual Methods

Inherited:

Gdl.DockObject (7), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_dock_drag_begin ()

do_dock_drag_end (cancelled)

do_dock_drag_motion (device, x, y)

do_move_focus_child (direction)

do_set_orientation (orientation)

Properties

Inherited:

Gdl.DockObject (4), Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

behavior

Gdl.DockItemBehavior

r/w

General behavior for the dock item (i.e. whether it can float, if it’s locked, etc.)

closed

bool

r/w

Whether the widget is closed.

iconified

bool

r/w

If set, the dock item is hidden but it has a corresponding icon in the dock bar allowing to show it again.

locked

bool

r/w

If set, the dock item cannot be dragged around and it doesn’t show a grip

orientation

Gtk.Orientation

r/w/c

Orientation of the docking item

preferred-height

int

r/w

Preferred height for the dock item

preferred-width

int

r/w

Preferred width for the dock item

resize

bool

r/w

If set, the dock item can be resized when docked in a GtkPanel widget

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gdl.DockObject (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

deselected

Signals that this dock has been deselected in a switcher.

dock-drag-begin

Signals that the dock item has begun to be dragged.

dock-drag-end

Signals that the dock item dragging has ended.

dock-drag-motion

Signals that a dock item dragging motion event has occured.

move-focus-child

The ::move-focus-child signal is emitted when a change of focus is requested for the child widget of a dock item.

selected

Signals that this dock has been selected from a switcher.

Fields

Inherited:

Gdl.DockObject (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

object

Gdl.DockObject

r

Class Details

class Gdl.DockItem(**kwargs)
Bases:

Gdl.DockObject

Abstract:

No

Structure:

Gdl.DockItemClass

classmethod new(name, long_name, behavior)
Parameters:
  • name (str) – Unique name for identifying the dock object.

  • long_name (str) – Human readable name for the dock object.

  • behavior (Gdl.DockItemBehavior) – General behavior for the dock item (i.e. whether it can float, if it’s locked, etc.), as specified by Gdl.DockItemBehavior flags.

Returns:

The newly created dock item grip widget.

Return type:

Gtk.Widget

Creates a new dock item widget.

classmethod new_with_pixbuf_icon(name, long_name, pixbuf_icon, behavior)
Parameters:
  • name (str) – Unique name for identifying the dock object.

  • long_name (str) – Human readable name for the dock object.

  • pixbuf_icon (GdkPixbuf.Pixbuf) – Pixbuf icon for the dock object.

  • behavior (Gdl.DockItemBehavior) – General behavior for the dock item (i.e. whether it can float, if it’s locked, etc.), as specified by Gdl.DockItemBehavior flags.

Returns:

The newly created dock item grip widget.

Return type:

Gtk.Widget

Creates a new dock item grip widget with a given pixbuf icon.

New in version 3.3.2.

classmethod new_with_stock(name, long_name, stock_id, behavior)
Parameters:
  • name (str) – Unique name for identifying the dock object.

  • long_name (str) – Human readable name for the dock object.

  • stock_id (str) – Stock icon for the dock object.

  • behavior (Gdl.DockItemBehavior) – General behavior for the dock item (i.e. whether it can float, if it’s locked, etc.), as specified by Gdl.DockItemBehavior flags.

Returns:

The newly created dock item grip widget.

Return type:

Gtk.Widget

Creates a new dock item grip widget with a given stock id.

classmethod set_has_grip(has_grip)
Parameters:

has_grip (bool) – True is the dock item has a grip

Define in the corresponding kind of dock item has a grip. Even if an item has a grip it can be hidden.

New in version 3.6.

bind(dock)
Parameters:

dock (Gtk.Widget) – The Gdl.Dock widget to bind it to. Note that this widget must be a type of Gdl.Dock.

Binds this dock item to a new dock master.

dock_to(target, position, docking_param)
Parameters:
  • target (Gdl.DockItem or None) – The dock item that will be used as the point of reference.

  • position (Gdl.DockPlacement) – The position to dock #item, relative to #target.

  • docking_param (int) – This value is unused, and will be ignored.

Relocates a dock item to a new location relative to another dock item.

get_behavior_flags()
Returns:

the behavior of the item.

Return type:

Gdl.DockItemBehavior

Retrieves the behavior of the item.

New in version 3.6.

get_child()
Returns:

pointer to child of the Gdl.DockItem

Return type:

Gtk.Widget

Gets the child of the Gdl.DockItem, or None if the item contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

New in version 3.6.

get_drag_area(rect)
Parameters:

rect (Gdk.Rectangle) – A pointer to a Gdk.Rectangle that will receive the drag position

Gets the size and the position of the drag window in pixels.

New in version 3.6.

get_grip()
Returns:

Returns the current label widget.

Return type:

Gtk.Widget or None

This function returns the dock item’s grip label widget.

get_orientation()
Returns:

the orientation of the object.

Return type:

Gtk.Orientation

Retrieves the orientation of the object.

New in version 3.6.

get_tablabel()
Returns:

Returns the tab label widget.

Return type:

Gtk.Widget

Gets the current tab label widget. Note that this label widget is only visible when the “switcher-style” property of the Gdl.DockMaster is set to Gdl.SwitcherStyle.TABS

hide_grip()

This function hides the dock item’s grip widget.

hide_item()

This function hides the dock item. Since version 3.6, when dock items are hidden they are not removed from the layout.

The dock item close button causes the panel to be hidden.

iconify_item()

This function iconifies the dock item. When dock items are iconified they are hidden, and appear only as icons in dock bars.

The dock item iconify button causes the panel to be iconified.

is_closed()
Returns:

True if the dock item is closed.

Return type:

bool

Checks whether a given Gdl.DockItem is closed. It can be only hidden or detached.

New in version 3.6.

is_iconified()
Returns:

True if the dock item is iconified.

Return type:

bool

Checks whether a given Gdl.DockItem is iconified.

New in version 3.6.

is_placeholder()
Returns:

True if the dock item is a placeholder

Return type:

bool

Checks whether a given Gdl.DockItem is a placeholder created by the Gdl.DockLayout object and does not contain a child.

New in version 3.6.

lock()

This function locks the dock item. When locked the dock item cannot be dragged around and it doesn’t show a grip.

notify_deselected()

This function emits the deselected signal. It is used by Gdl.Switcher to let clients know that this item has been deselected.

notify_selected()

This function emits the selected signal. It is to be used by Gdl.Switcher to let clients know that this item has been switched to.

or_child_has_focus()
Returns:

True if the dock item or its child widget has focus; False otherwise.

Return type:

bool

Checks whether a given Gdl.DockItem or its child widget has focus. This check is performed recursively on child widgets.

New in version 3.3.2.

preferred_size(req)
Parameters:

req (Gtk.Requisition) – A pointer to a Gtk.Requisition into which the preferred size will be written.

Gets the preferred size of the dock item in pixels.

set_behavior_flags(behavior, clear)
Parameters:
  • behavior (Gdl.DockItemBehavior) – Behavior flags to turn on

  • clear (bool) – Whether to clear state before turning on flags

This function sets the behavior of the dock item.

New in version 3.6.

set_child(child)
Parameters:

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

Set a new child for the Gdl.DockItem. This child is different from the children using the Gtk.Container interface. It is a private child reserved for the widget implementation.

If a child is already present, it will be replaced. If widget is None the child will be removed.

New in version 3.6.

set_default_position(reference)
Parameters:

reference (Gdl.DockObject) – The Gdl.DockObject which is the default dock for self

This method has only an effect when you add you dock_item with Gdl.DockItemBehavior.NEVER_FLOATING. In this case you have to assign it a default position.*

Deprecated 3.6: This function is doing nothing now.

set_orientation(orientation)
Parameters:

orientation (Gtk.Orientation) – The orientation to set the item to. If the orientation is set to Gtk.Orientation.VERTICAL, the grip widget will be shown along the top of the edge of item (if it is not hidden). If the orientation is set to Gtk.Orientation.HORIZONTAL, the grip widget will be shown down the left edge of the item (even if the widget text direction is set to RTL).

This function sets the layout of the dock item.

set_tablabel(tablabel)
Parameters:

tablabel (Gtk.Widget) – The widget that will become the tab label.

Replaces the current tab label widget with another widget. Note that this label widget is only visible when the “switcher-style” property of the Gdl.DockMaster is set to Gdl.SwitcherStyle.TABS

show_grip()

This function shows the dock item’s grip widget.

show_item()

This function shows the dock item. When dock items are shown, they are displayed in their normal layout position.

unbind()

Unbinds this dock item from it’s dock master.

unlock()

This function unlocks the dock item. When unlocked the dock item can be dragged around and can show a grip.

unset_behavior_flags(behavior)
Parameters:

behavior (Gdl.DockItemBehavior) – Behavior flags to turn off

This function sets the behavior of the dock item.

New in version 3.6.

do_dock_drag_begin() virtual
do_dock_drag_end(cancelled) virtual
Parameters:

cancelled (bool) –

do_dock_drag_motion(device, x, y) virtual
Parameters:
do_move_focus_child(direction) virtual
Parameters:

direction (Gtk.DirectionType) –

do_set_orientation(orientation) virtual
Parameters:

orientation (Gtk.Orientation) – The orientation to set the item to. If the orientation is set to Gtk.Orientation.VERTICAL, the grip widget will be shown along the top of the edge of item (if it is not hidden). If the orientation is set to Gtk.Orientation.HORIZONTAL, the grip widget will be shown down the left edge of the item (even if the widget text direction is set to RTL).

This function sets the layout of the dock item.

Signal Details

Gdl.DockItem.signals.deselected(dock_item)
Signal Name:

deselected

Flags:

RUN_FIRST

Parameters:

dock_item (Gdl.DockItem) – The object which received the signal

Signals that this dock has been deselected in a switcher.

Gdl.DockItem.signals.dock_drag_begin(dock_item)
Signal Name:

dock-drag-begin

Flags:

RUN_FIRST

Parameters:

dock_item (Gdl.DockItem) – The object which received the signal

Signals that the dock item has begun to be dragged.

Gdl.DockItem.signals.dock_drag_end(dock_item, cancel)
Signal Name:

dock-drag-end

Flags:

RUN_FIRST

Parameters:
  • dock_item (Gdl.DockItem) – The object which received the signal

  • cancel (bool) – This value is set to True if the drag was cancelled by the user. #cancel is set to False if the drag was accepted.

Signals that the dock item dragging has ended.

Gdl.DockItem.signals.dock_drag_motion(dock_item, device, x, y)
Signal Name:

dock-drag-motion

Flags:

RUN_FIRST

Parameters:
  • dock_item (Gdl.DockItem) – The object which received the signal

  • device (Gdk.Device) – The device used.

  • x (int) – The x-position that the dock item has been dragged to.

  • y (int) – The y-position that the dock item has been dragged to.

Signals that a dock item dragging motion event has occured.

Gdl.DockItem.signals.move_focus_child(dock_item, dir)
Signal Name:

move-focus-child

Flags:

RUN_LAST, ACTION

Parameters:

The ::move-focus-child signal is emitted when a change of focus is requested for the child widget of a dock item. The dir parameter specifies the direction in which focus is to be shifted.

New in version 3.3.2.

Gdl.DockItem.signals.selected(dock_item)
Signal Name:

selected

Flags:

RUN_FIRST

Parameters:

dock_item (Gdl.DockItem) – The object which received the signal

Signals that this dock has been selected from a switcher.

Property Details

Gdl.DockItem.props.behavior
Name:

behavior

Type:

Gdl.DockItemBehavior

Default Value:

Gdl.DockItemBehavior.NORMAL

Flags:

READABLE, WRITABLE

General behavior for the dock item (i.e. whether it can float, if it’s locked, etc.)

Gdl.DockItem.props.closed
Name:

closed

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If set, the dock item is closed.

New in version 3.6.

Gdl.DockItem.props.iconified
Name:

iconified

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If set, the dock item is hidden but it has a corresponding icon in the dock bar allowing to show it again.

New in version 3.6.

Gdl.DockItem.props.locked
Name:

locked

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If set, the dock item cannot be dragged around and it doesn’t show a grip

Gdl.DockItem.props.orientation
Name:

orientation

Type:

Gtk.Orientation

Default Value:

Gtk.Orientation.VERTICAL

Flags:

READABLE, WRITABLE, CONSTRUCT

The orientation of the docking item. If the orientation is set to Gtk.Orientation.VERTICAL, the grip widget will be shown along the top of the edge of item (if it is not hidden). If the orientation is set to Gtk.Orientation.HORIZONTAL, the grip widget will be shown down the left edge of the item (even if the widget text direction is set to RTL).

Gdl.DockItem.props.preferred_height
Name:

preferred-height

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Preferred height for the dock item

Gdl.DockItem.props.preferred_width
Name:

preferred-width

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Preferred width for the dock item

Gdl.DockItem.props.resize
Name:

resize

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If set, the dock item can be resized when docked in a GtkPanel widget