def do_close(win): if win.busy: stdwin.message('Can\'t close busy window') return # need to fail if quitting?? win.editor = None # Break circular reference #del win.editmenu # What about the filemenu?? mainloop.unregister(win) win.close()
def close(self): if self in allwindows: allwindows.remove(self) mainloop.unregister(self.window) self.window.dispatch = None self.window.close() if self.history: wwwutil.save_file(self.history + [self.cur_addr], \ history_file, HISTORY) wwwutil.save_file(bookmarks, bookmarks_file, BOOKMARKS) wwwutil.save_file(places, places_file, PLACES)
def lpdispatch(event): type, win, detail = event if type == WE_CLOSE or type == WE_CHAR and detail in ('q', 'Q'): mainloop.unregister(win) elif type == WE_DRAW: drawproc(win) elif type == WE_TIMER: update(win) win.change((0,0), (10000, 10000)) elif type == WE_MOUSE_UP: win.settimer(1)
def cdispatch(event): type, win, detail = event if type == WE_DRAW: drawproc(win, detail) elif type == WE_TIMER: settimer(win) drawproc(win, EVERYWHERE) elif type in MOUSE_EVENTS: mouseclick(win, type, detail) elif type == WE_ACTIVATE: if win.ring: # Turn the ringing off win.ring = 0 win.begindrawing().invert(win.mainarea) elif type == WE_SIZE: win.change(EVERYWHERE) setdimensions(win) elif type == WE_CLOSE: mainloop.unregister(win) win.close()
def cddispatch(type, win, detail): if type == WE_NULL: pass elif type == WE_CLOSE: mainloop.unregister(win) win.close() elif type == WE_DRAW: draw(win) elif type == WE_TIMER: update(win) elif type == WE_MOUSE_UP: left, top, right, bottom, v1, v2 = getgeo(win) h, v = detail[0] if left < h < right: if top < v < v1: but1(win) elif v1 < v < v2: but2(win) elif v2 < v < bottom: but3(win) else: stdwin.fleep()
def close(w): # Close method unregister(w) del w.close # Delete our close function w.close() # Call the close method
def destroy(self): mainloop.unregister(self.win) if self.child: self.child.destroy() self._reset()
def close(self): mainloop.unregister(self.win) del self.win.dispatch self.win.close()