[PYTHONMAC-SIG] Default Tk attributes?
Ivan Herman
Ivan.Herman@cwi.nl
Tue, 31 Dec 1996 15:43:28 +0100
------------------ Your Original Message: --------------------
>
>
> The Tk "option" command (in Tkinter, the widget methods option_add(),
> option_clear(), option_get() and option_readline()) can be used to
> manipulate defaults for widget options, I believe. See the Tk man
> page for option. It looks like it would be easy to have a file of
> options in X resource style and read that at the start of your
> program.
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>
Oops, I was a bit too fast in sending the question to the
list... Indeed, the methods are there and they work. Better, there is
also an option_readfile() which does exactly what you suggest.
The reason why I haven't realized that the functions are there is
because I looked at the Tkinter Life Preserver doc only, which does not
refer to these methods (they are defined for the class 'Misc'), and I
haven't looked at the Tkinter sources...
Having said that, there is still a very small difference in the
cross-platform behaviours: I guess the file ~/.xdefaults is
automatically considered by Tk on UNIX (at least that is what Matt's
book says). On the other hand, there is definitely no automatic
configuration on the Mac. What it would require is to slightly modify
the Tkinter file to read in such a file and interpret it in, say, the
__init__ of the class Misc (or Tk). Is it worth bothering? Maybe not...
Ivan
=================
PYTHONMAC-SIG - SIG on Python for the Apple Macintosh
send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
=================