classification
Title: ttk Style().configure() overwrites Tk().option_add() Button but not Label
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: qubodup, serhiy.storchaka
Priority: normal Keywords:

Created on 2016-09-29 15:28 by qubodup, last changed 2016-09-29 21:59 by qubodup. This issue is now closed.

Files
File name Uploaded Description Edit
1475162805-.png qubodup, 2016-09-29 15:28 screenshot of result
issue28313.tcl serhiy.storchaka, 2016-09-29 20:44
Messages (3)
msg277706 - (view) Author: qubodup (qubodup) Date: 2016-09-29 15:28
The following code will result in a small label and a big button:

from tkinter import *
from tkinter.ttk import *

root = Tk()

root.option_add("*Font", "sans-serif 12")

s = Style()
s.configure('TButton', font=('courier', 40))
s.configure('TLabel', font=('courier', 40))

Label(root, text="lbl").pack()
Button(root, text="bttn").pack()

root.mainloop()


It seems to me that both should have the same style. Removing the root.option_add line fixes it of course but this is a stripped-down example and in other cases it might be needed.
msg277727 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-29 20:44
This is not Tkinter issue. Pure Tcl/Tk script shows the same result. If this is a bug (I don't know), this is Tk bug.
msg277730 - (view) Author: qubodup (qubodup) Date: 2016-09-29 21:59
Thank you for clarifying, reported at http://core.tcl.tk/tk/tktview/1dde2144bdcc5a93f8724fc1b1b85b19114e42c0
History
Date User Action Args
2016-09-29 21:59:23qubodupsetmessages: + msg277730
2016-09-29 20:44:50serhiy.storchakasetstatus: open -> closed
files: + issue28313.tcl


nosy: + serhiy.storchaka
messages: + msg277727
resolution: third party
stage: resolved
2016-09-29 15:28:28qubodupcreate