Kaydet (Commit) f023ab04 authored tarafından Guido van Rossum's avatar Guido van Rossum

Dialog.py: d.num should be numeric, not string

Tkinter.py: on destroy(), remove self from master's dict of children
üst c1be9d59
......@@ -4,11 +4,12 @@ from Tkinter import *
class Dialog(Widget):
def __init__(self, master=None, cnf={}):
Widget._setup(self, master, cnf)
self.num = apply(self.tk.call,
('tk_dialog', self._w,
cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default'])
+ cnf['strings'])
self.num = self.tk.getint(
apply(self.tk.call,
('tk_dialog', self._w,
cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default'])
+ cnf['strings']))
try: Widget.destroy(self)
except TclError: pass
def destroy(self): pass
......
......@@ -679,6 +679,8 @@ class Widget(Misc, Pack, Place):
return self._w
def destroy(self):
for c in self.children.values(): c.destroy()
if self.master.children.has_key(self._name):
del self.master.children[self._name]
self.tk.call('destroy', self._w)
def _do(self, name, args=()):
return apply(self.tk.call, (self._w, name) + args)
......
......@@ -4,11 +4,12 @@ from Tkinter import *
class Dialog(Widget):
def __init__(self, master=None, cnf={}):
Widget._setup(self, master, cnf)
self.num = apply(self.tk.call,
('tk_dialog', self._w,
cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default'])
+ cnf['strings'])
self.num = self.tk.getint(
apply(self.tk.call,
('tk_dialog', self._w,
cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default'])
+ cnf['strings']))
try: Widget.destroy(self)
except TclError: pass
def destroy(self): pass
......
......@@ -679,6 +679,8 @@ class Widget(Misc, Pack, Place):
return self._w
def destroy(self):
for c in self.children.values(): c.destroy()
if self.master.children.has_key(self._name):
del self.master.children[self._name]
self.tk.call('destroy', self._w)
def _do(self, name, args=()):
return apply(self.tk.call, (self._w, name) + args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment