diff options
author | Guido van Rossum <guido@python.org> | 1995-09-01 20:35:37 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-09-01 20:35:37 (GMT) |
commit | bf4d8f9d876d422ebf760998544e0eb8b72aa524 (patch) | |
tree | c5495cd23c6c9ef5019e0214ac0a002568143076 | |
parent | cf9e27c72e43e663629116057184752edd6548c8 (diff) | |
download | cpython-bf4d8f9d876d422ebf760998544e0eb8b72aa524.zip cpython-bf4d8f9d876d422ebf760998544e0eb8b72aa524.tar.gz cpython-bf4d8f9d876d422ebf760998544e0eb8b72aa524.tar.bz2 |
added OptionMenu class (tk_optionMenu interface)
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 12 | ||||
-rwxr-xr-x | Lib/tkinter/Tkinter.py | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 1b22100..914c603 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -69,6 +69,7 @@ SEL_LAST='sel.last' END='end' INSERT='insert' CURRENT='current' +ANCHOR='anchor' def _flatten(tuple): res = () @@ -739,8 +740,7 @@ class Widget(Misc, Pack, Place): cnf = _cnfmerge((cnf, kw)) self.widgetName = widgetName Widget._setup(self, master, cnf) - extra1=() - apply(self.tk.call, extra1+(widgetName, self._w)+extra) + apply(self.tk.call, (widgetName, self._w)+extra) if cnf: Widget.config(self, cnf) def config(self, cnf=None, **kw): @@ -1288,6 +1288,14 @@ class Text(Widget): def yview_pickplace(self, *what): apply(self.tk.call, (self._w, 'yview', '-pickplace')+what) +class OptionMenu(Widget): + def __init__(self, master, variable, value, *values): + self.widgetName = 'tk_optionMenu' + Widget._setup(self, master, {}) + self.menuname = apply( + self.tk.call, + (self.widgetName, self._w, variable, value) + values) + class Image: def __init__(self, imgtype, name=None, cnf={}, **kw): self.name = None diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 1b22100..914c603 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -69,6 +69,7 @@ SEL_LAST='sel.last' END='end' INSERT='insert' CURRENT='current' +ANCHOR='anchor' def _flatten(tuple): res = () @@ -739,8 +740,7 @@ class Widget(Misc, Pack, Place): cnf = _cnfmerge((cnf, kw)) self.widgetName = widgetName Widget._setup(self, master, cnf) - extra1=() - apply(self.tk.call, extra1+(widgetName, self._w)+extra) + apply(self.tk.call, (widgetName, self._w)+extra) if cnf: Widget.config(self, cnf) def config(self, cnf=None, **kw): @@ -1288,6 +1288,14 @@ class Text(Widget): def yview_pickplace(self, *what): apply(self.tk.call, (self._w, 'yview', '-pickplace')+what) +class OptionMenu(Widget): + def __init__(self, master, variable, value, *values): + self.widgetName = 'tk_optionMenu' + Widget._setup(self, master, {}) + self.menuname = apply( + self.tk.call, + (self.widgetName, self._w, variable, value) + values) + class Image: def __init__(self, imgtype, name=None, cnf={}, **kw): self.name = None |