An Introduction to Tkinter (Draft Edition)
(new in Tk 8.4) The PanedWindow widget is a geometry manager widget, which can contain one or more child widgets ("panes"). The child widgets can be resized by the user, by moving separator lines ("sashes") using the mouse.
The PanedWindow widget can be used to implement common 2-pane and 3-pane layouts.
Here's how to create a 2-pane widget:
from Tkinter import * m = PanedWindow(orient=VERTICAL) m.pack(fill=BOTH, expand=1) top = Label(m, text="top pane") m.add(top) bottom = Label(m, text="bottom pane") m.add(bottom) mainloop()
Here's how to create a 3-pane widget:
from Tkinter import * m1 = PanedWindow() m1.pack(fill=BOTH, expand=1) left = Label(m1, text="left pane") m1.add(left) m2 = PanedWindow(m1, orient=VERTICAL) m1.add(m2) top = Label(m2, text="top pane") m2.add(top) bottom = Label(m2, text="bottom pane") m2.add(bottom) mainloop()
A paned window manager widget. This widget manages one or more child widgets, and allows the user to resize these widgets, by moving the separators between them.
Adds a child window to the paned window.
Modifies one or more widget options. If no options are given, the method returns a dictionary containing all current option values.
Removes a child window.
Identifies the widget element at the given position.
Gets a child window option.
Same as paneconfigure.
Set child window configuration options.
Returns a list of child widgets.
Gets the most recent proxy position.
Removes the proxy.
Places the proxy at the given position.
Same as forget.
Gets the current position for a sash (separator).
Drag the sash (separator) to a new position, relative to the mark. Together with sash_mark, this method is used by the widget bindings to move a sash by dragging the mouse. The mark method is called when the mouse is pressed over a sash (you can use identify to figure out which sash to mark), and the dragto method is called repeatedly when the mouse pointer is moved.
Note that this method is missing from the Tkinter bindings in Python 2.3. You can use sash("dragto", index, x, y) instead.
Registers the current mouse position. See sash_dragto for more information.
Note that this method only takes a single argument in the Tkinter bindings shipped with in Python 2.3. To pass in all three arguments, use sash("mark", index, x, y).
Moves the sash (separator) to a given position.
Copyright © 1997-2005 by Fredrik Lundh.