gtk.Paneda base class for widgets with two adjustable
panesSynopsisgtk.Panedgtk.Containeradd1childadd2childpack1childresizeFalseshrinkTruepack2childresizeTrueshrinkTrueget_positionset_positionpositioncompute_positionallocationchild1_reqchild2_reqget_child1get_child2Ancestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Container
+-- gtk.Paned
Implemented Interfacesgtk.Paned
implements
gtk.Buildablegtk.Paned Propertiesgtk.Object Propertiesgtk.Widget Propertiesgtk.Container Properties
"max-position"ReadThe largest possible value for the position property.
This property is derived from the size and shrinkability of the widget's
children. Available in GTK+ 2.4 and above."min-position"ReadThe smallest possible value for the position property.
This property is derived from the size and shrinkability of the widget's
children. Available in GTK+ 2.4 and above."position"Read-WriteThe position of the paned separator in pixels (0 means
all the way to the left or top)."position-set"Read-WriteIf True, the "position" property is
valid.
gtk.Paned Child Properties
"resize"Read-WriteIf True, the child expands and
shrinks along with the paned widget. Available in GTK+ 2.4 and above."shrink"Read-WriteIf True, the child can be made
smaller than its requisition. Available in GTK+ 2.4 and above.
gtk.Paned Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypes"accept-position"callbackpaneduser_param1..."cancel-position"callbackpaneduser_param1..."cycle-child-focus"callbackpanedreverseduser_param1..."cycle-handle-focus"callbackpanedreverseduser_param1..."move-handle"callbackpanedscrolltypeuser_param1..."toggle-handle-focus"callbackpaneduser_param1...Descriptiongtk.Paned is the base
class for widgets with two panes, arranged either horizontally (gtk.HPaned) or
vertically (gtk.VPaned). Child
widgets are added to the panes of the widget with the pack1() and
pack2()
methods. The division between the two children is set by default from the
size requests of the children, but it can be adjusted by the user.A paned widget draws a separator between the two 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. (The space in
which the separator located is called the gutter.) Often, it is useful to
put each child inside a gtk.Frame with the
shadow type set to gtk.SHADOW_IN so that the gutter
appears as a ridge.Each child has two options that can be set, resize and shrink. If
resize is True, when the gtk.Paned is resized,
that child will expand or shrink along with the paned widget. If shrink is
True, the child can be made smaller than it's
requisition. Setting shrink to False allows the
application to set a minimum size. If resize is False for
both children, the resizing behaves as if resize is True
for both children. The application can set the position of the slider by
calling the set_position()
method.Methodsgtk.Paned.add1add1childchild :the widget to addThe add1() method adds the widget
specified by child to the top or left pane with the
default packing parameters (resize is False and shrink is
True). See the pack1()
method.gtk.Paned.add2add2childchild :the widget to addThe add2() method adds the widget
specified by child to the bottom or right pane with
the default packing parameters (resize is True and shrink
is True). See the pack2()
method.gtk.Paned.pack1pack1childresizeFalseshrinkTruechild :the widget to addresize :if Truechild should resize when the paned is
resizedshrink :if Truechild can be made smaller than its
minimum size requestThe pack1() method adds the widget
specified by child to the top or left pane with the
parameters specified by resize and
shrink. If resize is
Truechild should be resized when
the paned widget is resized. If shrink is
Truechild can be made smaller
than its minimum size request.gtk.Paned.pack2pack2childresizeTrueshrinkTruechild :the widget to addresize :if Truechild should resize when the paned is
resizedshrink :if Truechild can be made smaller than its
minimum size requestThe pack2() method adds the widget
specified by child to the bottom or right pane with
the parameters specified by resize and
shrink. If resize is
Truechild should be resized when
the paned widget is resized. If shrink is
Truechild can be made smaller
than its minimum size request.gtk.Paned.get_positionget_positionReturns :the position of the dividerThe get_position() method returns the
position of the divider in pixels between the two panes.gtk.Paned.set_positionset_positionpositionposition :the new pixel position of divider, a negative
value means that the position is unset.The set_position() method sets the
position of the divider between the two panes to the value specified by
position and sets the "position-set" property to
True if position is non-negative.
If position is negative the divider position will be
recalculated by the paned widget using the child widget requisitions and the
"position-set" property will be set to False.gtk.Paned.compute_positioncompute_positionallocationchild1_reqchild2_reqallocation :the total space allocation in pixels for the
paned widgetchild1_req :the minimum space in pixels required for the
left or top child widgetchild2_req :the minimum space in pixels required for the
right or bottom child widgetThe compute_position() method computes
the position of the separator according to the specification of the
parameters: allocation,
child1_req and child2_req. The
calculation is affected by the packing parameters of the child widgets
depending on whether they can resize and shrink. This method is used by
subclasses of gtk.Paned and is
usually not needed by applications. the gtk.Widget.queue_resize()
method must be called after this method to have the resizing
displayed.The minimum position is 0 if child1's shrink value is
True or the value of child1_req,
if False. The maximum position is the value of
allocation if child2's shrink value is True, or the
value of (allocation -
child2_req), if False. The final
calculated position will be between the minimum and maximum
positions.gtk.Paned.get_child1get_child1Returns :the first child, orNoneThis method is available in PyGTK 2.4 and above.The get_child1() method returns the
first child of the paned widget.gtk.Paned.get_child2get_child2Returns :the second child, or
NoneThis method is available in PyGTK 2.4 and above.The get_child2() method returns
the second child of the paned widget.SignalsThe "accept-position" gtk.Paned Signalcallbackpaneduser_param1...paned :the paned that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "accept-position" signal is emitted when
paned has the focus and any of the
Return, Enter, Space keys
are pressed. This will also cause the child widget with the focus to be
activated.The "cancel-position" gtk.Paned Signalcallbackpaneduser_param1...paned :the paned that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "cancel-position" signal is emitted when the
Esc key is pressed while paned has
the focus.The "cycle-child-focus" gtk.Paned Signalcallbackpanedreverseduser_param1...paned :the paned that received the
signalreversed :if True the focus cycle
direction should be reverseduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "cycle-child-focus" signal is emitted when
F6 or ShiftF6 is
pressed while paned has the focus.The "cycle-handle-focus" gtk.Paned Signalcallbackpanedreverseduser_param1...paned :the paned that received the
signalreversed :if True the focus cycle
direction should be reverseduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "cycle-handle-focus" signal is emitted when
paned has the focus and any of the
Tab,
CtrlTab, ShiftTab or
CtrlShiftTab keys combinations are pressed. Tab and
CtrlTab set reversed to
False while
ShiftTab and CtrlShiftTab set reversed to
True.The "move-handle" gtk.Paned Signalcallbackpanedscrolltypeuser_param1...paned :the paned that received the
signalscrolltype :the scroll type:
gtk.SCROLL_NONE, gtk.SCROLL_JUMP,
gtk.SCROLL_STEP_BACKWARD,
gtk.SCROLL_STEP_FORWARD,
gtk.SCROLL_PAGE_BACKWARD,
gtk.SCROLL_PAGE_FORWARD,
gtk.SCROLL_STEP_UP,
gtk.SCROLL_STEP_DOWN,
gtk.SCROLL_PAGE_UP,
gtk.SCROLL_PAGE_DOWN,
gtk.SCROLL_STEP_LEFT,
gtk.SCROLL_STEP_RIGHT,
gtk.SCROLL_PAGE_LEFT,
gtk.SCROLL_PAGE_RIGHT,
gtk.SCROLL_START or
gtk.SCROLL_ENDuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "move-handle" signal is emitted when
paned has the focus and one of the following key
combinations is pressed to move the separator:Left
ArrowRight
ArrowUp ArrowDown
ArrowPage UpPage DownHomeEndThe value of scrolltype is one of:
gtk.SCROLL_NONE, gtk.SCROLL_JUMP,
gtk.SCROLL_STEP_BACKWARD,
gtk.SCROLL_STEP_FORWARD,
gtk.SCROLL_PAGE_BACKWARD,
gtk.SCROLL_PAGE_FORWARD,
gtk.SCROLL_STEP_UP,
gtk.SCROLL_STEP_DOWN,
gtk.SCROLL_PAGE_UP,
gtk.SCROLL_PAGE_DOWN,
gtk.SCROLL_STEP_LEFT,
gtk.SCROLL_STEP_RIGHT,
gtk.SCROLL_PAGE_LEFT,
gtk.SCROLL_PAGE_RIGHT,
gtk.SCROLL_START or gtk.SCROLL_END.
The default handler for this signal moves the separator if the separator has
the focus.The "toggle-handle-focus" gtk.Paned Signalcallbackpaneduser_param1...paned :the paned that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThe "toggle-handle-focus" signal is emitted when
paned has the focus and F8 is
pressed to give the focus to or take the focus from the separator
handle.