Custom scaling factor for Tk 9 widgets

Liste des GroupesRevenir à cl tcl 
Sujet : Custom scaling factor for Tk 9 widgets
De : wortkarg3 (at) *nospam* yahoo.com (Harald Oehlmann)
Groupes : comp.lang.tcl
Date : 24. Mar 2025, 12:07:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrree2$k10l$2@dont-email.me>
User-Agent : Mozilla Thunderbird
Dear Tk team, dear Csaba,
thanks for making Tk scalable.
Please allow me to ask a dump question.
My applications do use a custom scaling factor based on character size.
For the AWThemes, there was the possibility of a scaling factor and I set it before activating the theme. This scales all elements like checkboxes etc.
Here is a snippet with a font size in points in Config(FontSize): example: 32
package require awthemes
# >> Do AWDark scaling
# >> Get element scaling factor from current font size
set dFontSpec [font actual TkDefaultFont]
dict set dFontSpec -size $Config(FontSize)
set ScaleCur [expr {
double([font metrics $dFontSpec -ascent])
/ [font metrics TkDefaultFont -ascent]}]
::themeutils::setThemeColors AWDark scale.factor $ScaleCur
package require AWDark
ttk::style theme use AWDark
Is it possible to do something like this with plain Tk 9.0 ?
Is it even possible to change the scaling factor on runtime ?
(this is not possible with the AWThemes) ?
Thanks for any answer,
Harald
P.S.: and it is so sad, that Brad Lanam is gone. With Tk 9, the AWThemes would be even greater...

Date Sujet#  Auteur
24 Mar 25 * Custom scaling factor for Tk 9 widgets3Harald Oehlmann
24 Mar 25 `* Re: Custom scaling factor for Tk 9 widgets2nemethi
24 Mar 25  `- Re: Custom scaling factor for Tk 9 widgets1Harald Oehlmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal