Gtk.HandleBox

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 Gtk.Bin Gtk.Bin Gtk.HandleBox Gtk.HandleBox Gtk.Bin->Gtk.HandleBox Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

get_child_detached ()

get_handle_position ()

get_shadow_type ()

get_snap_edge ()

set_handle_position (position)

set_shadow_type (type)

set_snap_edge (edge)

Virtual Methods

Inherited:

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

do_child_attached (child)

do_child_detached (child)

Properties

Inherited:

Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

child-detached

bool

r

A boolean value indicating whether the handlebox’s child is attached or detached.

handle-position

Gtk.PositionType

r/w

Position of the handle relative to the child widget

shadow-type

Gtk.ShadowType

r/w

Appearance of the shadow that surrounds the container

snap-edge

Gtk.PositionType

r/w

Side of the handlebox that’s lined up with the docking point to dock the handlebox

snap-edge-set

bool

r/w

Whether to use the value from the snap_edge property or a value derived from handle_position

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

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

Name

Short Description

child-attached

This signal is emitted when the contents of the handlebox are reattached to the main window. deprecated

child-detached

This signal is emitted when the contents of the handlebox are detached from the main window. deprecated

Fields

Inherited:

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

Name

Type

Access

Description

bin

Gtk.Bin

r

Class Details

class Gtk.HandleBox(**kwargs)
Bases:

Gtk.Bin

Abstract:

No

Structure:

Gtk.HandleBoxClass

The Gtk.HandleBox widget allows a portion of a window to be “torn off”. It is a bin widget which displays its child and a handle that the user can drag to tear off a separate window (the “float window”) containing the child widget. A thin “ghost” is drawn in the original location of the handlebox. By dragging the separate window back to its original location, it can be reattached.

When reattaching, the ghost and float window, must be aligned along one of the edges, the “snap edge”. This either can be specified by the application programmer explicitly, or GTK+ will pick a reasonable default based on the handle position.

To make detaching and reattaching the handlebox as minimally confusing as possible to the user, it is important to set the snap edge so that the snap edge does not move when the handlebox is deattached. For instance, if the handlebox is packed at the bottom of a VBox, then when the handlebox is detached, the bottom edge of the handlebox’s allocation will remain fixed as the height of the handlebox shrinks, so the snap edge should be set to Gtk.PositionType.BOTTOM.

Gtk.HandleBox has been deprecated. It is very specialized, lacks features to make it useful and most importantly does not fit well into modern application design. Do not use it. There is no replacement.

classmethod new()[source]
Returns:

a new Gtk.HandleBox.

Return type:

Gtk.Widget

Create a new handle box.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

get_child_detached()[source]
Returns:

True if the child is currently detached, otherwise False

Return type:

bool

Whether the handlebox’s child is currently detached.

New in version 2.14.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

get_handle_position()[source]
Returns:

the current handle position.

Return type:

Gtk.PositionType

Gets the handle position of the handle box. See Gtk.HandleBox.set_handle_position().

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

get_shadow_type()[source]
Returns:

the type of shadow currently drawn around the handle box.

Return type:

Gtk.ShadowType

Gets the type of shadow drawn around the handle box. See Gtk.HandleBox.set_shadow_type().

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

get_snap_edge()[source]
Returns:

the edge used for determining reattachment, or (Gtk.PositionType)-1 if this is determined (as per default) from the handle position.

Return type:

Gtk.PositionType

Gets the edge used for determining reattachment of the handle box. See Gtk.HandleBox.set_snap_edge().

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

set_handle_position(position)[source]
Parameters:

position (Gtk.PositionType) – the side of the handlebox where the handle should be drawn.

Sets the side of the handlebox where the handle is drawn.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

set_shadow_type(type)[source]
Parameters:

type (Gtk.ShadowType) – the shadow type.

Sets the type of shadow to be drawn around the border of the handle box.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

set_snap_edge(edge)[source]
Parameters:

edge (Gtk.PositionType) – the snap edge, or -1 to unset the value; in which case GTK+ will try to guess an appropriate value in the future.

Sets the snap edge of a handlebox. The snap edge is the edge of the detached child that must be aligned with the corresponding edge of the “ghost” left behind when the child was detached to reattach the torn-off window. Usually, the snap edge should be chosen so that it stays in the same place on the screen when the handlebox is torn off.

If the snap edge is not set, then an appropriate value will be guessed from the handle position. If the handle position is Gtk.PositionType.RIGHT or Gtk.PositionType.LEFT, then the snap edge will be Gtk.PositionType.TOP, otherwise it will be Gtk.PositionType.LEFT.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

do_child_attached(child) virtual
Parameters:

child (Gtk.Widget) –

Signal emitted when the contents of the handlebox are reattached to the main window. Deprecated: 3.4.

do_child_detached(child) virtual
Parameters:

child (Gtk.Widget) –

Signal emitted when the contents of the handlebox are detached from the main window. Deprecated: 3.4.

Signal Details

Gtk.HandleBox.signals.child_attached(handle_box, widget)
Signal Name:

child-attached

Flags:

RUN_FIRST

Parameters:
  • handle_box (Gtk.HandleBox) – The object which received the signal

  • widget (Gtk.Widget) – the child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)

This signal is emitted when the contents of the handlebox are reattached to the main window.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

Gtk.HandleBox.signals.child_detached(handle_box, widget)
Signal Name:

child-detached

Flags:

RUN_FIRST

Parameters:
  • handle_box (Gtk.HandleBox) – The object which received the signal

  • widget (Gtk.Widget) – the child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)

This signal is emitted when the contents of the handlebox are detached from the main window.

Deprecated since version 3.4: Gtk.HandleBox has been deprecated.

Property Details

Gtk.HandleBox.props.child_detached
Name:

child-detached

Type:

bool

Default Value:

False

Flags:

READABLE

A boolean value indicating whether the handlebox’s child is attached or detached.

Gtk.HandleBox.props.handle_position
Name:

handle-position

Type:

Gtk.PositionType

Default Value:

Gtk.PositionType.LEFT

Flags:

READABLE, WRITABLE

Position of the handle relative to the child widget

Gtk.HandleBox.props.shadow_type
Name:

shadow-type

Type:

Gtk.ShadowType

Default Value:

Gtk.ShadowType.OUT

Flags:

READABLE, WRITABLE

Appearance of the shadow that surrounds the container

Gtk.HandleBox.props.snap_edge
Name:

snap-edge

Type:

Gtk.PositionType

Default Value:

Gtk.PositionType.TOP

Flags:

READABLE, WRITABLE

Side of the handlebox that’s lined up with the docking point to dock the handlebox

Gtk.HandleBox.props.snap_edge_set
Name:

snap-edge-set

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether to use the value from the snap_edge property or a value derived from handle_position