etk.DockPaned

class etk.docking.DockPaned

Bases: gtk.Container

The etk.DockPaned widget is a container widget with multiple panes arranged either horizontally or vertically, depending on the value of the orientation property. Child widgets are added to the panes of the widget with the append_item(), prepend_item() or insert_item() methods.

A dockpaned widget draws a separator between it’s child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator.

get_handle_size()
Returns:the size of the handles in the dockpaned.

Retrieves the size of the handles in the dockpaned.

set_handle_size(handle_size)
Parameters:handle_size – the new size for the handles in the dockpaned.

Sets the size for the handles in the dockpaned.

get_orientation()
Returns:the orientation of the dockpaned.

Retrieves the orientation of the dockpaned.

set_orientation(orientation)
Parameters:orientation – the dockpaned’s new orientation.

Sets the orientation of the dockpaned.

append_item(child)
Parameters:child – the gtk.Widget to use as the contents of the item.
Returns:the index number of the item in the dockpaned.

The append_item() method prepends an item to the dockpaned.

prepend_item(child)
Parameters:child – the gtk.Widget to use as the contents of the item.
Returns:the index number of the item in the dockpaned.

The prepend_item() method prepends an item to the dockpaned.

insert_item(child, position=None, weight=None)
Parameters:
  • child – a gtk.Widget` to use as the contents of the item.
  • position – the index (starting at 0) at which to insert the item, negative or None to append the item after all other items.
  • weight – The relative amount of space the child should get. No guarantees.
Returns:

the index number of the item in the dockpaned.

The insert_item() method inserts an item into the dockpaned at the location specified by position (0 is the first item). child is the widget to use as the contents of the item. If position is negative or None the item is appended to the dockpaned.

remove_item(item_num)
Parameters:item_num – the index (starting from 0) of the item to remove. If None or negative, the last item will be removed.

The remove_item() method removes the item at the location specified by item_num. The value of item_num starts from 0. If item_num is negative or None the last item of the dockpaned will be removed.

item_num(child)
Parameters:child – a gtk.Widget.
Returns:the index of the item containing child, or None if child is not in the dockpaned.

The item_num() method returns the index of the item which contains the widget specified by child or None if no item contains child.

get_nth_item(item_num)
Parameters:item_num – the index of an item in the dockpaned.
Returns:the child widget, or None if item_num is out of bounds.

The get_nth_item‘ method returns the child widget contained at the index specified by `item_num(). If item_num is out of bounds for the item range of the dockpaned this method returns None.

get_item_at_pos(x, y)
Parameters:
  • x – the x coordinate of the position.
  • y – the y coordinate of the position.
Returns:

the child widget at the position specified by x and y or None.

The get_item_at_pos() method returns the child widget whose allocation contains the position specified by x and y or None if no child widget is at that position.

reorder_item(child, position)
Parameters:
  • child – the child widget to move.
  • position – the index that child is to move to, or None to move to the end.

The reorder_item() method reorders the dockpaned child widgets so that child appears in the location specified by position. If position is greater than or equal to the number of children in the list or negative or None, child will be moved to the end of the list.

Previous topic

etk.DockFrame

Next topic

etk.DockGroup

This Page