summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-09-05 16:46:31 (GMT)
committerGuido van Rossum <guido@python.org>1996-09-05 16:46:31 (GMT)
commit2caac73aa69120580bc4dc1d5817b9c2c3d05abf (patch)
tree3424af79c56fb7da0801d681fd3cd9ed4a887d33 /Lib/tkinter
parente1a7a3b3b349ffd24cf25593a446e9f9bec9d615 (diff)
downloadcpython-2caac73aa69120580bc4dc1d5817b9c2c3d05abf.zip
cpython-2caac73aa69120580bc4dc1d5817b9c2c3d05abf.tar.gz
cpython-2caac73aa69120580bc4dc1d5817b9c2c3d05abf.tar.bz2
Added Menu.insert*() methods [Fred]
Diffstat (limited to 'Lib/tkinter')
-rwxr-xr-xLib/tkinter/Tkinter.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py
index f43e3d6..1f784fd 100755
--- a/Lib/tkinter/Tkinter.py
+++ b/Lib/tkinter/Tkinter.py
@@ -1255,6 +1255,19 @@ class Menu(Widget):
self.add('radiobutton', cnf or kw)
def add_separator(self, cnf={}, **kw):
self.add('separator', cnf or kw)
+ def insert(self, index, itemType, cnf={}, **kw):
+ apply(self.tk.call, (self._w, 'insert', index, itemType)
+ + self._options(cnf, kw))
+ def insert_cascade(self, index, cnf={}, **kw):
+ self.insert(index, 'cascade', cnf or kw)
+ def insert_checkbutton(self, index, cnf={}, **kw):
+ self.insert(index, 'checkbutton', cnf or kw)
+ def insert_command(self, index, cnf={}, **kw):
+ self.insert(index, 'command', cnf or kw)
+ def insert_radiobutton(self, index, cnf={}, **kw):
+ self.insert(index, 'radiobutton', cnf or kw)
+ def insert_separator(self, index, cnf={}, **kw):
+ self.insert(index, 'separator', cnf or kw)
def delete(self, index1, index2=None):
self.tk.call(self._w, 'delete', index1, index2)
def entryconfig(self, index, cnf=None, **kw):