Tkinter Entry widgets 'font' property (API ?) changed in Python 2.5.2 ?

Atul atul.nene at gmail.com
Sat Aug 9 09:51:13 CEST 2008


Hi Eric,

Thanks for your response.

> Tkinter is a very thin wrapper over an embedded tcl/tk interpreter. So I  
> guess the API change is caused by a tcl/tk version change, not by a Python  
> one. You can check the version of the tcl/tk interpreter you're using from  
> Python via:
>
> root = Tkinter.Tk()
> root.tk.eval('puts $tcl_patchLevel')
> root.tk.eval('puts $tk_patchLevel')
>

The Windows box reports 8.4.12 whereas the OpenSuze 11 box reports
8.5.2
I suppose the Suze 10.2 box had a lesser version and hence the API
change.

> > 2. How can I achieve what I want alternatively ?
>
> I'd use this way:
>
> import tkFont
> entryFontDescr = Entry()["font"]
> entry_font = tkFont.Font(font=entryFontDescr)
> print entry_font.actual()
>

This works very well, thank you :)

Regards,
-- Atul



More information about the Python-list mailing list