[Tkinter-discuss] From wxPython to TK

Michael Lange klappnase at web.de
Fri Mar 20 12:10:02 CET 2009

On Thu, 19 Mar 2009 08:51:38 -0700
Tim Jones <timj at tolisgroup.com> wrote:


> 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).


> HTH,
> Tim
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss

More information about the Tkinter-discuss mailing list