TypeError: unbound method destroy() must be called

Jane McFrech omcatseng at yahoo.com
Sat Aug 10 01:30:05 EDT 2002


Hi I have gotten weird response from python2.2.  When I try to quit the boot
window, all I got is TypeError: unbound method destroy() must be called with
Widget instance as first arugment (got boot instance instead). I didnt have
this problem before with python 1.5. Dont know whats going wrong.


class boot(Toplevel):
    def __init__(self,parent):

        apply(Toplevel.__init__, (self, parent))

        self._parent=parent


    def prewin_quit(self):
        self.destroy()
        self._parent.destroy()

if __name__ == '__main__':

    if Tkinter._default_root is None:
        _root = Tkinter.Tk()
    else:
        _root = Tkinter._default_root

    Pmw.initialise(_root, fontScheme = 'pmw1')
    _root.title('hidden')
    _root.withdraw()

    widget=boot(_root)
    _root.mainloop()






More information about the Python-list mailing list