]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Dialog.py: d.num should be numeric, not string
authorGuido van Rossum <guido@python.org>
Tue, 30 Aug 1994 12:13:44 +0000 (12:13 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Aug 1994 12:13:44 +0000 (12:13 +0000)
Tkinter.py: on destroy(), remove self from master's dict of children

Lib/lib-tk/Dialog.py
Lib/lib-tk/Tkinter.py
Lib/tkinter/Dialog.py
Lib/tkinter/Tkinter.py

index 28222ecb07d772b2ddebcadae28255e532b976f3..022bd96a76a293a53fcce961348326467cb2a01e 100644 (file)
@@ -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
index 5a2e6b28e11be28c897ce426dab7bc0f06c55656..4b012f19880d198b3e690b862ad4f0d9afe4ab56 100644 (file)
@@ -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) 
index 28222ecb07d772b2ddebcadae28255e532b976f3..022bd96a76a293a53fcce961348326467cb2a01e 100755 (executable)
@@ -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
index 5a2e6b28e11be28c897ce426dab7bc0f06c55656..4b012f19880d198b3e690b862ad4f0d9afe4ab56 100755 (executable)
@@ -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)