Search code examples
pythontkinterttk

Tkinter ttk.PanedWindow sash position


Hi can anyone please tell me if there is a way to get the sash positon of a ttk PanedWindow. With tk.PanedWindow you can use sash_coord() but that doesn't seem to work for ttk.


Solution

  • You can use the sashpos method. It takes an index for the Nth sash. For example, if you just have a single sash separating two widgets, you would use the value 0 (zero):

    pw = ttk.Panedwindow(...)
    ...
    print(pw.sashpos(0))