From a1db48b75b88b1fdb36b96dd3dac59abfc1e9abe Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 9 Oct 1995 22:37:28 +0000 Subject: fix Menu.add_command etc. --- Lib/lib-tk/Tkinter.py | 20 ++++++++++---------- Lib/tkinter/Tkinter.py | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 12a1acc..1703395 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1105,16 +1105,16 @@ class Menu(Widget): def add(self, itemType, cnf={}, **kw): apply(self.tk.call, (self._w, 'add', itemType) + self._options(cnf, kw)) - def add_cascade(self, cnf={}): - self.add('cascade', cnf) - def add_checkbutton(self, cnf={}): - self.add('checkbutton', cnf) - def add_command(self, cnf={}): - self.add('command', cnf) - def add_radiobutton(self, cnf={}): - self.add('radiobutton', cnf) - def add_separator(self, cnf={}): - self.add('separator', cnf) + def add_cascade(self, cnf={}, **kw): + self.add('cascade', cnf or kw) + def add_checkbutton(self, cnf={}, **kw): + self.add('checkbutton', cnf or kw) + def add_command(self, cnf={}, **kw): + self.add('command', cnf or kw) + def add_radiobutton(self, cnf={}, **kw): + self.add('radiobutton', cnf or kw) + def add_separator(self, cnf={}, **kw): + self.add('separator', cnf or kw) def delete(self, index1, index2=None): self.tk.call(self._w, 'delete', index1, index2) def entryconfig(self, index, cnf={}, **kw): diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 12a1acc..1703395 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -1105,16 +1105,16 @@ class Menu(Widget): def add(self, itemType, cnf={}, **kw): apply(self.tk.call, (self._w, 'add', itemType) + self._options(cnf, kw)) - def add_cascade(self, cnf={}): - self.add('cascade', cnf) - def add_checkbutton(self, cnf={}): - self.add('checkbutton', cnf) - def add_command(self, cnf={}): - self.add('command', cnf) - def add_radiobutton(self, cnf={}): - self.add('radiobutton', cnf) - def add_separator(self, cnf={}): - self.add('separator', cnf) + def add_cascade(self, cnf={}, **kw): + self.add('cascade', cnf or kw) + def add_checkbutton(self, cnf={}, **kw): + self.add('checkbutton', cnf or kw) + def add_command(self, cnf={}, **kw): + self.add('command', cnf or kw) + def add_radiobutton(self, cnf={}, **kw): + self.add('radiobutton', cnf or kw) + def add_separator(self, cnf={}, **kw): + self.add('separator', cnf or kw) def delete(self, index1, index2=None): self.tk.call(self._w, 'delete', index1, index2) def entryconfig(self, index, cnf={}, **kw): -- cgit v0.12