Sun Bear
Sun Bear

Reputation: 8297

Exposing sash or handle of tkinter.ttk.Panedwindow?

Is there a way to show the sash/handle of the ttk.Panedwindow widget? These options are not available in it stylename (see below).

Stylename = TPanedwindow
Layout    = [('Panedwindow.background', {'sticky': ''})]
Element(s) = ['Panedwindow.background']
Panedwindow.background         options: ('background',)

Documentation has described that these options are not support, while they are available in tk.Panedwindow. Still, I want to verify its veracity and if anyone knows how to expose the sash/handle of the ttk.Panewindow widget?

Upvotes: 0

Views: 1452

Answers (1)

Sun Bear
Sun Bear

Reputation: 8297

On Linux distro such as Ubuntu 16.04, I discovered that the tkinter.ttk.Panedwindow widget can display a handle between panes. But this appearance only occur when ttk.Style.theme_use('clam') is defined. Other style themes, e.g.'classic', 'default' and 'alt', do not display a handle for the panes of the ttk.Panedwindow widget.

ttk.Panedwindow with handle

Test script:

import tkinter.ttk as ttk

s = ttk.Style()
s.theme_use('clam') #Ubuntu 16.04 using this theme displayed handle btw panes

pw0 = ttk.Panedwindow()
pw0.pack(fill='both', expand=1)

l1 = ttk.Label(pw0, text="pane 1")
l2 = ttk.Label(pw0, text="pane 2")
pw0.add(l1)
pw0.add(l2)

pw0.master.geometry('150x100+100+100')

Upvotes: 2

Related Questions