Next / Previous / Contents / Shipman's homepage

38. ttk.PanedWindow

This is the ttk version of Section 19, “The PanedWindow widget”. To create a ttk.PanedWindow widget as the child of a given parent widget:

    w = ttk.PanedWindow(parent, option=value, ...)

The options for this constructor are given in Table 52, “ttk.PanedWindow options”.

Table 52. ttk.PanedWindow options

class_ The widget class name. This may be specified when the widget is created, but cannot be changed later. For an explanation of widget classes, see Section 27, “Standardizing appearance”.
cursor The cursor that will appear when the mouse is over the checkbutton; see Section 5.8, “Cursors”.
height The height dimension of the widget.
orient To stack child widgets side by side, use orient=tk.HORIZONTAL. To stack them top to bottom, use orient=tk.VERTICAL. The default option is tk.VERTICAL.
style The style to be used in rendering this widget; see Section 49, “Using and customizing ttk styles”.
takefocus By default, a ttk.PanedWindow will not be included in focus traversal; see Section 53, “Focus: routing keyboard input”. To add the widget to focus traversal, use takefocus=True.
width The width dimension of the widget.

These options of the Tkinter.PanedWindow widget are not supported by the ttk.PanedWindow constructor:

Table 53. Tkinter PanedWindow options not in ttk.PanedWindow

background or bg Configure the background option using a style. The bg abbreviation is not supported.
borderwidth or bd Not supported.
cursor The cursor that will appear when the mouse is over the widget; see Section 5.8, “Cursors”.
handlepad Not supported.
handlesize Not supported.
opaqueresize Not supported.
relief Not supported.
sashrelief Not supported.
sashwidth Not supported.
showhandle Not supported.

Methods on a ttk.PanedWindow include all those described in Section 46, “Methods common to all ttk widgets”, plus:

.add(w[, weight=N])

Add a new pane to the window, where w is any widget (but typically a Frame). If you provide a weight option, it describes the size of the pane in the stacking dimension, relative to the other panes. For example, for orient=tk.VERTICAL, if pane 0 has weight=1 and pane 1 has weight=3, initially the first pane will have 1/4 of the height and the second pane will have 3/4.

.forget(what)

Remove a pane. The argument may be either the index of the pane, counting from zero, or the child widget.

.insert(where, w[, weight=N])

Add a new pane w to the window at the position specified by where, where where may be either an index or the pane widget before which you want to insert the new pane.

.panes()

This method returns a list of the PanedWindow's child widgets.