The problem is that if you really want to control the style in detail, you need to use a layout. Therefore, first define the widget class using:
>>b=ttk.Button(None) >>b.winfo_class() 'TButton
Then use the command
>>> s.layout('TButton') [("Button.border", {"children": [("Button.focus", {"children": [("Button.spacing", {"children": [("Button.label", {"sticky": "nswe"})], "sticky": "nswe"})], "sticky": "nswe"})], "sticky": "nswe", "border": "1"})]
Finally, change what you want:
s.layout("MYButton.TButton",[("Button.border", {"children": [("Button.focus", {"children": [("Button.spacing", {"children": [("Button.label", {"sticky": "nswe"})], "sticky": "nswe"})], "sticky": "nswe"})], "sticky": "we", "border": "1"})]
This did the trick for me and finally provided me with a way to control my ttk widget !!!
Luke
Lucag source share