Re: 4k HiDPI displays and tkinter
Aivar Annamaa <[email protected]> Tue, 13 Jul 2021 13:41:29 +0300
| Newsgroups | gmane.comp.python.tkinter |
|---|---|
| Message-ID | <CAEbkakebsXgajPbwGFP0biVR36Yu+PQuKQVtU7f0OCOb0vgkZA@mail.gmail.com> |
--===============6376076424968630089== Content-Type: multipart/alternative; boundary="0000000000000dad0905c6fee2da" --0000000000000dad0905c6fee2da Content-Type: text/plain; charset="UTF-8" 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/3f2607ff0b27ffedac9b24a107ea9fff5f6b1f1f/thonny/ui_utils.py#L2271 Best regards, Aivar On Mon, Jul 12, 2021 at 8:13 PM Vasilis Vlachoudis < [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 > instead? > - 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] > https://mail.python.org/mailman/listinfo/tkinter-discuss > --0000000000000dad0905c6fee2da Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <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 co= mpute pixel distances for <i>em</i>-s:=C2=A0<a href=3D"https://github.com/t= honny/thonny/blob/3f2607ff0b27ffedac9b24a107ea9fff5f6b1f1f/thonny/ui_utils.= py#L2271">https://github.com/thonny/thonny/blob/3f2607ff0b27ffedac9b24a107e= a9fff5f6b1f1f/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 Vasilis Vlachoudis <<a h= ref=3D"mailto:[email protected]">[email protected]</a>>= ; 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-size:1= 0pt">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 "mm" 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 sty= le=3D"font-family:Helvetica">Vasilis=C2=A0</span><span style=3D"font-family= :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">Tkinter-dis= [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> --0000000000000dad0905c6fee2da-- --===============6376076424968630089== 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 --===============6376076424968630089==--