Re: 4k HiDPI displays and tkinter

Vasilis Vlachoudis <[email protected]> Wed, 14 Jul 2021 13:48:43 +0000
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
--===============7229063066919388805==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_0BC70B5D93E054469872FFD0FE07220E033835D72CCERNXCHG54cer_"

--_000_0BC70B5D93E054469872FFD0FE07220E033835D72CCERNXCHG54cer_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you all for the suggestions.
I am going to try them.
It would have been nice it tk had a global option to rescale everything by =
x2
Like in XFCE window manager

Vasilis

________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=3Dcern.ch=
@python.org] on behalf of Aivar Annamaa [[email protected]]
Sent: Tuesday, July 13, 2021 12:41
To: [email protected]
Subject: Re: [Tkinter-discuss] 4k HiDPI displays and tkinter

If you want to relate your screen distances to the size of characters in a =
font, then you could use font's `measure` method to compute pixel distances=
 for em-s: https://github.com/thonny/thonny/blob/3f2607ff0b27ffedac9b24a107=
ea9fff5f6b1f1f/thonny/ui_utils.py#L2271

Best regards,
Aivar

On Mon, Jul 12, 2021 at 8:13 PM Vasilis Vlachoudis <Vasilis.Vlachoudis@cern=
.ch<mailto:[email protected]>> wrote:
Recently I've got a 4k laptop, and the first experience with linux and the =
4k display is quite painful.
I am still trying to tune it but for the moment my tkinter applications do =
not render nicely on such a display.
- all widths like borderwidths, decorations, separators etc, set in pixels =
do not scale with the dpi settings. Could we use "mm" for their settings in=
stead?
- checkbox, radiobox the indicator appears tiny wrt the text

Is there a way to detect from tkinter a high res display and force a window=
 scaling x2 for everything?
What is your experience with such displays?

Vasilis
_______________________________________________
Tkinter-discuss mailing list
[email protected]<mailto:[email protected]>
https://mail.python.org/mailman/listinfo/tkinter-discuss

--_000_0BC70B5D93E054469872FFD0FE07220E033835D72CCERNXCHG54cer_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html dir=3D"ltr">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" id=3D"owaParaStyle"></style>
</head>
<body fpstyle=3D"1" ocsi=3D"0">
<div style=3D"direction: ltr;font-family: Tahoma;color: #000000;font-size: =
10pt;">Thank you all for the suggestions.
<div>I am going to try them.</div>
<div>It would have been nice it tk had a global option to rescale everythin=
g by x2<br>
Like in XFCE window manager</div>
<div>
<div><br>
<div style=3D"font-family:Tahoma; font-size:13px">
<div style=3D"font-family:Tahoma; font-size:13px">
<div style=3D"font-size:13px; font-family:Tahoma">
<div style=3D"font-size:13px; font-family:Tahoma"><font size=3D"1"><span st=
yle=3D"font-family:Helvetica">Vasilis</span><br style=3D"font-family:Helvet=
ica">
<span style=3D"font-family:Helvetica"><br>
</span></font></div>
</div>
</div>
</div>
</div>
<div style=3D"font-family: Times New Roman; color: #000000; font-size: 16px=
">
<hr tabindex=3D"-1">
<div id=3D"divRpF448604" style=3D"direction: ltr;"><font face=3D"Tahoma" si=
ze=3D"2" color=3D"#000000"><b>From:</b> Tkinter-discuss [tkinter-discuss-bo=
unces&#43;[email protected]] on behalf of Aivar Annam=
aa [[email protected]]<br>
<b>Sent:</b> Tuesday, July 13, 2021 12:41<br>
<b>To:</b> [email protected]<br>
<b>Subject:</b> Re: [Tkinter-discuss] 4k HiDPI displays and tkinter<br>
</font><br>
</div>
<div></div>
<div>
<div dir=3D"ltr">If you want to relate your screen distances to the size of=
 characters in a font, then you could use font's `measure` method to comput=
e pixel distances for
<i>em</i>-s:&nbsp;<a href=3D"https://github.com/thonny/thonny/blob/3f2607ff=
0b27ffedac9b24a107ea9fff5f6b1f1f/thonny/ui_utils.py#L2271" target=3D"_blank=
" rel=3D"noopener noreferrer">https://github.com/thonny/thonny/blob/3f2607f=
f0b27ffedac9b24a107ea9fff5f6b1f1f/thonny/ui_utils.py#L2271</a>
<div><br>
</div>
<div>Best regards,<br>
Aivar</div>
</div>
<br>
<div class=3D"gmail_quote">
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 12, 2021 at 8:13 PM Vasil=
is Vlachoudis &lt;<a href=3D"mailto:[email protected]" target=3D"_=
blank" rel=3D"noopener noreferrer">[email protected]</a>&gt; wrote=
:<br>
</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex; border=
-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div style=3D"direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-siz=
e:10pt">
Recently I've got a 4k laptop, and the first experience with linux and the =
4k display is quite painful.
<div>I am still trying to tune it but for the moment my tkinter application=
s do not render nicely on such a display.</div>
<div>- all widths like borderwidths, decorations, separators etc, set in pi=
xels do not scale with the dpi settings. Could we use &quot;mm&quot; for th=
eir settings instead?</div>
<div>- checkbox, radiobox the indicator appears tiny wrt the text</div>
<div><br>
</div>
<div>Is there a way to detect from tkinter a high res display and force a w=
indow scaling x2 for everything?</div>
<div>What is your experience with such displays?</div>
<div>
<div><br>
<div style=3D"font-family:Tahoma; font-size:13px">
<div style=3D"font-family:Tahoma; font-size:13px">
<div style=3D"font-size:13px; font-family:Tahoma">
<div style=3D"font-size:13px; font-family:Tahoma"><font size=3D"1"><span st=
yle=3D"font-family:Helvetica">Vasilis&nbsp;</span><span style=3D"font-famil=
y:Helvetica"><br>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Tkinter-discuss mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"noop=
ener noreferrer">[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman/listinfo/tkinter-discuss" rel=3D=
"noreferrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/tki=
nter-discuss</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

--_000_0BC70B5D93E054469872FFD0FE07220E033835D72CCERNXCHG54cer_--

--===============7229063066919388805==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tkinter-discuss mailing list
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss

--===============7229063066919388805==--