Tkinter or Python issue?

Eugene Druker ledruker at rogers.com
Wed Oct 19 00:26:46 EDT 2005


"Ron Provost" <ronpro at cox.net> wrote in message
news:98i5f.3686$vS1.1306 at dukeread03...
> [snip]
> t.insert( Tk.END, sampleText )
>
> t.tag_config( 'AB', font=tkFont.Font( family='ariel', size=24,
> weight=tkFont.BOLD ) )
> t.tag_config( 'TBU', font=tkFont.Font( family='times', size=10,
> weight=tkFont.BOLD, underline=1 ) )
>
> t.tag_add( 'AB', '1.8', '1.15' )
> t.tag_add( 'TBU', '2.10', '2.30' )
>
> root.mainloop( )
> [snip]

tkFont.Font(...) is a class instance, while you need font description.
Try:
t.tag.config( 'TBU', font=('times', 12, 'bold','underline') )
t.tag_config( 'AB', font=('arial',24,'bold') )

Eugene





More information about the Python-list mailing list