[PYTHONMAC-SIG] Default Tk attributes?

Guido van Rossum guido@CNRI.Reston.Va.US
Mon, 30 Dec 1996 10:39:04 -0500


> If I use Tk on a UNIX box, the X resource mechanism gives me a way
> to give default values for various attributes like background
> colour, font, etc. Tk is (more or less) prepared to follow the
> Xresource style in this respect.

> Is there an analoguous mechanism on the Mac? To give a very specific
> example, the font used by default in, e.g., Button or Label are far
> too big for my small PowerBook screen. The only way I could do it up
> to now is to set the font explicitely for each widget I create, but
> some more general way would be much nicer.

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/)

=================
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
=================