mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Turn leading minus sign into underscore for image widget name -- the
hyphen confused Tk into thinking the name was an option.
This commit is contained in:
parent
27cb8a4884
commit
58103d3b11
2 changed files with 10 additions and 6 deletions
|
@ -54,7 +54,6 @@ def _cnfmerge(cnfs):
|
||||||
if type(cnfs) is DictionaryType:
|
if type(cnfs) is DictionaryType:
|
||||||
return cnfs
|
return cnfs
|
||||||
elif type(cnfs) in (NoneType, StringType):
|
elif type(cnfs) in (NoneType, StringType):
|
||||||
|
|
||||||
return cnfs
|
return cnfs
|
||||||
else:
|
else:
|
||||||
cnf = {}
|
cnf = {}
|
||||||
|
@ -1531,7 +1530,6 @@ class _setit:
|
||||||
def __init__(self, var, value):
|
def __init__(self, var, value):
|
||||||
self.__value = value
|
self.__value = value
|
||||||
self.__var = var
|
self.__var = var
|
||||||
|
|
||||||
def __call__(self, *args):
|
def __call__(self, *args):
|
||||||
self.__var.set(self.__value)
|
self.__var.set(self.__value)
|
||||||
|
|
||||||
|
@ -1564,7 +1562,11 @@ class Image:
|
||||||
master = _default_root
|
master = _default_root
|
||||||
if not master: raise RuntimeError, 'Too early to create image'
|
if not master: raise RuntimeError, 'Too early to create image'
|
||||||
self.tk = master.tk
|
self.tk = master.tk
|
||||||
if not name: name = `id(self)`
|
if not name:
|
||||||
|
name = `id(self)`
|
||||||
|
# The following is needed for systems where id(x)
|
||||||
|
# can return a negative number, such as Linux/m68k:
|
||||||
|
if name[0] == '-': name = '_' + name[1:]
|
||||||
if kw and cnf: cnf = _cnfmerge((cnf, kw))
|
if kw and cnf: cnf = _cnfmerge((cnf, kw))
|
||||||
elif kw: cnf = kw
|
elif kw: cnf = kw
|
||||||
options = ()
|
options = ()
|
||||||
|
|
|
@ -54,7 +54,6 @@ def _cnfmerge(cnfs):
|
||||||
if type(cnfs) is DictionaryType:
|
if type(cnfs) is DictionaryType:
|
||||||
return cnfs
|
return cnfs
|
||||||
elif type(cnfs) in (NoneType, StringType):
|
elif type(cnfs) in (NoneType, StringType):
|
||||||
|
|
||||||
return cnfs
|
return cnfs
|
||||||
else:
|
else:
|
||||||
cnf = {}
|
cnf = {}
|
||||||
|
@ -1531,7 +1530,6 @@ class _setit:
|
||||||
def __init__(self, var, value):
|
def __init__(self, var, value):
|
||||||
self.__value = value
|
self.__value = value
|
||||||
self.__var = var
|
self.__var = var
|
||||||
|
|
||||||
def __call__(self, *args):
|
def __call__(self, *args):
|
||||||
self.__var.set(self.__value)
|
self.__var.set(self.__value)
|
||||||
|
|
||||||
|
@ -1564,7 +1562,11 @@ class Image:
|
||||||
master = _default_root
|
master = _default_root
|
||||||
if not master: raise RuntimeError, 'Too early to create image'
|
if not master: raise RuntimeError, 'Too early to create image'
|
||||||
self.tk = master.tk
|
self.tk = master.tk
|
||||||
if not name: name = `id(self)`
|
if not name:
|
||||||
|
name = `id(self)`
|
||||||
|
# The following is needed for systems where id(x)
|
||||||
|
# can return a negative number, such as Linux/m68k:
|
||||||
|
if name[0] == '-': name = '_' + name[1:]
|
||||||
if kw and cnf: cnf = _cnfmerge((cnf, kw))
|
if kw and cnf: cnf = _cnfmerge((cnf, kw))
|
||||||
elif kw: cnf = kw
|
elif kw: cnf = kw
|
||||||
options = ()
|
options = ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue