From 13dc4f71a903ee38510aff6583a82435fbdf700b Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 31 Aug 1995 13:38:01 +0000 Subject: [PATCH] Fixed dialog-window event handling --- Mac/Lib/FrameWork.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py index bb379cc9dc9..c32651c3348 100644 --- a/Mac/Lib/FrameWork.py +++ b/Mac/Lib/FrameWork.py @@ -120,21 +120,18 @@ class Application: yield = -1 def do1event(self, mask = everyEvent, wait = 0): - event = self.getevent(mask, wait) - if event: + ok, event = self.getevent(mask, wait) + if IsDialogEvent(event): + if self.do_dialogevent(event): + return + if ok: self.dispatch(event) def getevent(self, mask = everyEvent, wait = 0): ok, event = WaitNextEvent(mask, wait) - if ok: - return event - else: - return None - + return ok, event + def dispatch(self, event): - if IsDialogEvent(event): - self.do_dialogevent(event) - return (what, message, when, where, modifiers) = event if eventname.has_key(what): name = "do_" + eventname[what] @@ -150,9 +147,11 @@ class Application: gotone, window, item = DialogSelect(event) if gotone: if self._windows.has_key(window): - window.do_itemhit(item, event) + self._windows[window].do_itemhit(item, event) else: print 'Dialog event for unknown dialog' + return 1 + return 0 def do_mouseDown(self, event): (what, message, when, where, modifiers) = event @@ -579,7 +578,6 @@ class DialogWindow(Window): self.do_postopen() def close(self): - self.wid.DisposeDialog() self.do_postclose() def do_itemhit(self, item, event):