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 |
|---|---|---|
|
|
Constructor keyword. An accent color, optionally with a variant. See Styling options for the available styles. |
|
|
The layout direction of the panes: |
|
|
The requested width, in pixels. |
|
|
The requested height, in pixels. |
|
|
The mouse cursor over the panedwindow (see Cursors). |
|
|
Whether the panedwindow accepts keyboard focus during traversal. |
Methods#
- add(child, **kw)
Add
childas a new pane.kwincludeweight.- 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:
- sashpos(index, newpos=None)
Get, or set, the pixel position of sash
index.- Return type:
Lower-level
sash_*andproxy_*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.
|
ttk style name |
|---|---|
|
|
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()
See also#
Panedwindow catalog page — usage, screenshots, and examples.
Tk ttk::panedwindow manual page — the canonical upstream reference (Tcl 8.6).