[Tkinter-discuss] 4k HiDPI displays and tkinter [cont]

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Thu Mar 17 05:47:16 EDT 2022


Hi Michael,

no I am using the default fonts.
What is different is the I have set a high DPI for the X-server to match the screen resolution.

I saw in the page
https://www.tcl.tk/man/tcl/TkCmd/ttk_treeview.html

under "Styling Options'
there is parameter to set the -rowheight
that needs to be defined as

ttk::style configure Treeview \
     -rowheight [expr {[font metrics font -linespace] + 2}]

however I could not find how to call this command, and when
If I do the following

style = ttk.Style()
style.configure("Treeview", rowheight="30")

it works, but it is not dynamic with the font size/dpi

Vasilis
________________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de]
Sent: Thursday, March 17, 2022 10:35
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] 4k HiDPI displays and tkinter [cont]

Hi,

On Wed, 16 Mar 2022 16:16:36 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> On the same topic of HiDPI screens, the Treeview seems to calculate
> wrongly the font height (see attach image)
> Do you know any way to correct that?
>

are you possibly using a point-sized font? If yes, maybe there is some
dpi issue again?

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

No problem is insoluble.
                -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


More information about the Tkinter-discuss mailing list