diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-17 08:00:19 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-17 08:00:19 (GMT) |
commit | d91085598f5185b267ea51a3f615da9527af2ed2 (patch) | |
tree | 80849b9455438e9963a61d7aff3fc3b060213553 /Demo/tkinter | |
parent | fe55464f393fc002fd0911a4d8dba6694723d408 (diff) | |
download | cpython-d91085598f5185b267ea51a3f615da9527af2ed2.zip cpython-d91085598f5185b267ea51a3f615da9527af2ed2.tar.gz cpython-d91085598f5185b267ea51a3f615da9527af2ed2.tar.bz2 |
Remove apply()
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-x | Demo/tkinter/guido/AttrDialog.py | 3 | ||||
-rwxr-xr-x | Demo/tkinter/guido/ManPage.py | 4 | ||||
-rwxr-xr-x | Demo/tkinter/guido/ShellWindow.py | 2 | ||||
-rwxr-xr-x | Demo/tkinter/guido/kill.py | 2 | ||||
-rw-r--r-- | Demo/tkinter/guido/optionmenu.py | 2 | ||||
-rw-r--r-- | Demo/tkinter/guido/sortvisu.py | 3 | ||||
-rwxr-xr-x | Demo/tkinter/guido/svkill.py | 4 | ||||
-rw-r--r-- | Demo/tkinter/matt/window-creation-w-location.py | 2 |
8 files changed, 10 insertions, 12 deletions
diff --git a/Demo/tkinter/guido/AttrDialog.py b/Demo/tkinter/guido/AttrDialog.py index 86333ad..9fa699e 100755 --- a/Demo/tkinter/guido/AttrDialog.py +++ b/Demo/tkinter/guido/AttrDialog.py @@ -155,8 +155,7 @@ class PackDialog(Dialog): def set(self, e=None): self.current = self.var.get() try: - apply(self.dialog.widget.pack, (), - {self.option: self.current}) + self.dialog.widget.pack(**{self.option: self.current}) except TclError, msg: print msg self.refresh() diff --git a/Demo/tkinter/guido/ManPage.py b/Demo/tkinter/guido/ManPage.py index 7d6fe00..911961e 100755 --- a/Demo/tkinter/guido/ManPage.py +++ b/Demo/tkinter/guido/ManPage.py @@ -22,7 +22,7 @@ class EditableManPage(ScrolledText): # Initialize instance def __init__(self, master=None, **cnf): # Initialize base class - apply(ScrolledText.__init__, (self, master), cnf) + ScrolledText.__init__(self, master, **cnf) # Define tags for formatting styles self.tag_config('X', underline=1) @@ -178,7 +178,7 @@ class ReadonlyManPage(EditableManPage): # Initialize instance def __init__(self, master=None, **cnf): cnf['state'] = DISABLED - apply(EditableManPage.__init__, (self, master), cnf) + EditableManPage.__init__(self, master, **cnf) # Alias ManPage = ReadonlyManPage diff --git a/Demo/tkinter/guido/ShellWindow.py b/Demo/tkinter/guido/ShellWindow.py index 609101b..6cdce0b 100755 --- a/Demo/tkinter/guido/ShellWindow.py +++ b/Demo/tkinter/guido/ShellWindow.py @@ -20,7 +20,7 @@ class ShellWindow(ScrolledText): args = string.split(shell) shell = args[0] - apply(ScrolledText.__init__, (self, master), cnf) + ScrolledText.__init__(self, master, **cnf) self.pos = '1.0' self.bind('<Return>', self.inputhandler) self.bind('<Control-c>', self.sigint) diff --git a/Demo/tkinter/guido/kill.py b/Demo/tkinter/guido/kill.py index e7df261..dd0dbf4 100755 --- a/Demo/tkinter/guido/kill.py +++ b/Demo/tkinter/guido/kill.py @@ -9,7 +9,7 @@ import os class BarButton(Menubutton): def __init__(self, master=None, **cnf): - apply(Menubutton.__init__, (self, master), cnf) + Menubutton.__init__(self, master, **cnf) self.pack(side=LEFT) self.menu = Menu(self, name='menu') self['menu'] = self.menu diff --git a/Demo/tkinter/guido/optionmenu.py b/Demo/tkinter/guido/optionmenu.py index be9d3ac..7365fa6 100644 --- a/Demo/tkinter/guido/optionmenu.py +++ b/Demo/tkinter/guido/optionmenu.py @@ -21,7 +21,7 @@ CHOICES = "Aah", "Bee", "Cee", "Dee", "Eff" var2 = StringVar() var2.set(CHOICES[0]) -menu2 = apply(OptionMenu, (root, var2) + tuple(CHOICES)) +menu2 = OptionMenu(root, var2, *CHOICES) menu2.pack() root.mainloop() diff --git a/Demo/tkinter/guido/sortvisu.py b/Demo/tkinter/guido/sortvisu.py index f18f2c1..3e4454f 100644 --- a/Demo/tkinter/guido/sortvisu.py +++ b/Demo/tkinter/guido/sortvisu.py @@ -523,8 +523,7 @@ class SortDemo: if self.size not in sizes: sizes.append(self.size) sizes.sort() - self.m_size = apply(OptionMenu, - (self.botleftframe, self.v_size) + tuple(sizes)) + self.m_size = OptionMenu(self.botleftframe, self.v_size, *sizes) self.m_size.pack(fill=X) self.v_speed = StringVar(self.master) diff --git a/Demo/tkinter/guido/svkill.py b/Demo/tkinter/guido/svkill.py index 69f7f3b..95f61b8 100755 --- a/Demo/tkinter/guido/svkill.py +++ b/Demo/tkinter/guido/svkill.py @@ -16,7 +16,7 @@ user = os.environ['LOGNAME'] class BarButton(Menubutton): def __init__(self, master=None, **cnf): - apply(Menubutton.__init__, (self, master), cnf) + Menubutton.__init__(self, master, **cnf) self.pack(side=LEFT) self.menu = Menu(self, name='menu') self['menu'] = self.menu @@ -61,7 +61,7 @@ class Kill(Frame): def do_1(self, e): self.kill(e.widget.get(e.widget.nearest(e.y))) def __init__(self, master=None, **cnf): - apply(Frame.__init__, (self, master), cnf) + Frame.__init__(self, master, **cnf) self.pack(expand=1, fill=BOTH) self.bar = Frame(self, name='bar', relief=RAISED, borderwidth=2) diff --git a/Demo/tkinter/matt/window-creation-w-location.py b/Demo/tkinter/matt/window-creation-w-location.py index 3f2b5b0..9f23bac 100644 --- a/Demo/tkinter/matt/window-creation-w-location.py +++ b/Demo/tkinter/matt/window-creation-w-location.py @@ -13,7 +13,7 @@ class QuitButton(Button): kwargs["text"] = "QUIT" if not kwargs.has_key("command"): kwargs["command"] = master.quit - apply(Button.__init__, (self, master) + args, kwargs) + Button.__init__(self, master, *args, **kwargs) class Test(Frame): def makeWindow(self, *args): |