Re: Tkinter update

Steven Miale (smiale@cs.indiana.edu)
Fri, 3 Jun 1994 11:32:51 -0500

>Comparing the Python code to the Tcl version, the most blatant
>difference is the many Pack.config() calls needed to emulate a single
>'pack configure' call. I think a streamlined interface for this is
>needed, e.g.
>
> w.pack({'side': 'left', 'expand': 1})

Add this method to the Widget class in Tkinter.py:

def pack(self, dict):
for key in dict.keys():
Pack.config(self, key, dict[key])

This changes:

Pack.config(msg, 'side', 'right')
Pack.config(msg, 'expand', 1)
Pack.config(msg, 'fill', 'both')
Pack.config(msg, 'padx', '3m')
Pack.config(msg, 'pady', '3m')

to:
msg.pack({'side': 'right',
'expand': 1,
'fill': 'both',
'padx': '3m',
'pady': '3m'})

Steve

-- 
Steven Miale - smiale@cs.indiana.edu| I was there at the dawn of the third age
Indiana University, Bloomington, IN | of man, and all I got was this lousy .sig