Panedwindow#

Panedwindow is the native ttk container that divides its space between children with draggable sashes (ttk.Panedwindow), themed by ttkbootstrap. This page is the complete reference for its options, methods, and styling.

Options#

Each option can be set in the constructor and changed later with configure().

Option

Type

Description

bootstyle

str

Constructor keyword. An accent color, optionally with a variant. See Styling options for the available styles.

orient

str

The layout direction of the panes: "horizontal" or "vertical".

width

int

The requested width, in pixels.

height

int

The requested height, in pixels.

cursor

str

The mouse cursor over the panedwindow (see Cursors).

takefocus

bool

Whether the panedwindow accepts keyboard focus during traversal.

Methods#

add(child, **kw)

Add child as a new pane. kw include weight.

Returns:

None.

insert(pos, child, **kw)

Insert a pane at pos.

Returns:

None.

remove(child)

Remove a pane. Aliased as forget.

Returns:

None.

pane(pane, option=None, **kw)

Query or set a pane’s options (e.g. weight).

panes()

Return the child widgets, in order.

Return type:

tuple

sashpos(index, newpos=None)

Get, or set, the pixel position of sash index.

Return type:

int

Lower-level sash_* and proxy_* methods also exist, for finer control over sash dragging.

Styling options#

This section is for changing how the panedwindow looks. Define a style with style.configure(...) (and style.map(...) for per-state colors), then apply it with Panedwindow(style=...).

Bootstyle mapping#

Any of the accent colors – primary, secondary, success, info, warning, danger, light, dark – substitutes for primary below. neutral does not apply to this family.

A vertical widget resolves to the Vertical. twin of each style name above.

bootstyle

ttk style name

primary

primary.Horizontal.TPanedwindow

Layout (elements)#

The widget is drawn from these nested parts. Each is an element you can target by name in a custom layout:

Panedwindow.background

Configurable style options#

Options you can set with style.configure(...) / style.map(...):

background

Supported states#

This style declares no style.map(...) overrides; any state-dependent appearance is drawn from its image elements.

Hand-styling example#

import ttkbootstrap as ttk

app = ttk.App()
style = app.style

style.configure("my.Horizontal.TPanedwindow", background="#3498db", foreground="white")
ttk.Panedwindow(app, style="my.Horizontal.TPanedwindow").pack(padx=8, pady=8)

app.mainloop()

Shared capabilities#

Panedwindow also has the methods every widget inherits — configuration, placement, event binding, lifecycle, focus, and introspection — plus the ttk state methods state / instate / identify. These are documented under Capabilities.

See also#