mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
added OptionMenu class (tk_optionMenu interface)
This commit is contained in:
parent
cf9e27c72e
commit
bf4d8f9d87
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user