setting the font in Tkinter

Rick Pasotto rickp at telocity.com
Sun Sep 17 17:53:45 EDT 2000


On 17 Sep 2000 16:58:38 +0200 in comp.lang.python, Bernhard Herzog wrote:
> rickp at telocity.com (Rick Pasotto) writes:
> 
> > This didn't work for me on linux. I got from the traceback:
> > 
> >     root.tk.call("option","*Font","Helvetica -24")
> > 	TclError: bad option "*Font": must be add, clear, get, or readfile
> 
> How about 
> 
>    root.option_add("*Font", "Helvetica -24")
> 
> It's usually better to call the appropriate methods instead of accessing
> the tk attribute directly.

Yes, that works. It's kind of hard to know what option_add does, let
alone how to use it, when the chapter that mentions it says "not yet
documented."

-- 
"Censorship, like charity, should begin at home, but unlike charity,
it should end there."
		-- Clare Boothe Luce
		   Rick Pasotto email: rickp at telocity.com



More information about the Python-list mailing list