Re: Force tkinter to use another fixed font
Sibylle Koczian <[email protected]> Wed, 22 Jul 2020 18:36:16 +0200
| Newsgroups | gmane.comp.python.tkinter |
|---|---|
| Message-ID | <[email protected]> |
Am 21.07.2020 um 18:30 schrieb Paul Malherbe:
> Hi
>
> ttk.Entry and ttk.Label use TkDefaultFont therefore changing TkFixedFont
> will not work.
>
Thank you for making me look at this - it's even worse: ttk.Label uses
TkDefaultFont, ttk.Entry uses TkTextFont. So that's definitely not the
right way.
> use
>
> style.configure("TLabel", font=yourfont)
>
> style.configure("TEntry", font=yourfont)
>
That's exactly the method I'd like to avoid: even a small to middling
application will use more than two different widget classes, and every
single one of them would need a separate call to style.configure. Every
change of the chosen font would have to be repeated for every widget class.
I had hoped that a style defined for the base class would be inherited
by subclasses, but that doesn't seem to be the case.
Will try next with setting a font for the Tk() instance.
Regards,
Sibylle