Tkinter or Python issue?
fredrik at pythonware.com
Wed Oct 19 09:11:12 CEST 2005
Eugene Druker wrote:
> tkFont.Font(...) is a class instance, while you need font description.
Font instances are font descriptors.
>>> f = tkFont.Font(family="ariel", size=24, weight=tkFont.BOLD)
<tkFont.Font instance at 0x00A3AC60>
>>> print f
> t.tag.config( 'TBU', font=('times', 12, 'bold','underline') )
> t.tag_config( 'AB', font=('arial',24,'bold') )
the problem here is a variation of the old garbage collection problem (Tcl
uses names as references, so the fact that Tk uses an object isn't enough to
keep Python's GC away from it). the solution is to hold on to the objects
More information about the Python-list