Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1db48b

Browse files
committed
fix Menu.add_command etc.
1 parent d462f3d commit a1db48b

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

Lib/lib-tk/Tkinter.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,16 +1105,16 @@ def activate(self, index):
11051105
def add(self, itemType, cnf={}, **kw):
11061106
apply(self.tk.call, (self._w, 'add', itemType)
11071107
+ self._options(cnf, kw))
1108-
def add_cascade(self, cnf={}):
1109-
self.add('cascade', cnf)
1110-
def add_checkbutton(self, cnf={}):
1111-
self.add('checkbutton', cnf)
1112-
def add_command(self, cnf={}):
1113-
self.add('command', cnf)
1114-
def add_radiobutton(self, cnf={}):
1115-
self.add('radiobutton', cnf)
1116-
def add_separator(self, cnf={}):
1117-
self.add('separator', cnf)
1108+
def add_cascade(self, cnf={}, **kw):
1109+
self.add('cascade', cnf or kw)
1110+
def add_checkbutton(self, cnf={}, **kw):
1111+
self.add('checkbutton', cnf or kw)
1112+
def add_command(self, cnf={}, **kw):
1113+
self.add('command', cnf or kw)
1114+
def add_radiobutton(self, cnf={}, **kw):
1115+
self.add('radiobutton', cnf or kw)
1116+
def add_separator(self, cnf={}, **kw):
1117+
self.add('separator', cnf or kw)
11181118
def delete(self, index1, index2=None):
11191119
self.tk.call(self._w, 'delete', index1, index2)
11201120
def entryconfig(self, index, cnf={}, **kw):

Lib/tkinter/Tkinter.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,16 +1105,16 @@ def activate(self, index):
11051105
def add(self, itemType, cnf={}, **kw):
11061106
apply(self.tk.call, (self._w, 'add', itemType)
11071107
+ self._options(cnf, kw))
1108-
def add_cascade(self, cnf={}):
1109-
self.add('cascade', cnf)
1110-
def add_checkbutton(self, cnf={}):
1111-
self.add('checkbutton', cnf)
1112-
def add_command(self, cnf={}):
1113-
self.add('command', cnf)
1114-
def add_radiobutton(self, cnf={}):
1115-
self.add('radiobutton', cnf)
1116-
def add_separator(self, cnf={}):
1117-
self.add('separator', cnf)
1108+
def add_cascade(self, cnf={}, **kw):
1109+
self.add('cascade', cnf or kw)
1110+
def add_checkbutton(self, cnf={}, **kw):
1111+
self.add('checkbutton', cnf or kw)
1112+
def add_command(self, cnf={}, **kw):
1113+
self.add('command', cnf or kw)
1114+
def add_radiobutton(self, cnf={}, **kw):
1115+
self.add('radiobutton', cnf or kw)
1116+
def add_separator(self, cnf={}, **kw):
1117+
self.add('separator', cnf or kw)
11181118
def delete(self, index1, index2=None):
11191119
self.tk.call(self._w, 'delete', index1, index2)
11201120
def entryconfig(self, index, cnf={}, **kw):

0 commit comments

Comments
 (0)