[Tkinter-discuss] From wxPython to TK

Tim Jones timj at tolisgroup.com
Fri Mar 20 16:35:35 CET 2009


On Mar 20, 2009, at 4:10 AM, Michael Lange wrote:

> On Thu, 19 Mar 2009 08:51:38 -0700
> Tim Jones <timj at tolisgroup.com> wrote:
>
> <snip>
>
>>
>> You can get the DPI value on Linux using "xdpyinfo | grep resolution"
>> in a terminal.
>>
>
> You can even do this from Tk, just type:
>
>     dpi_value = root.winfo_fpixels('1i')
>
> (where "root" is your Tk() window) to get the currently used dpi  
> value, or:
>
>     root.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0)
>
> to adjust the dpi value to your needs (this should be done before  
> creating any
> widgets besides the Tk() window though).

Outstanding!  Instant scaling and our apps look correct.

Thanks for the tip, Michael.

Tim



More information about the Tkinter-discuss mailing list