home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!gatech!news.byu.edu!news.mtholyoke.edu!nic.umass.edu!titan.ucc.umass.edu!rjr
- From: rjr@titan.ucc.umass.edu (Richard J. Resnick)
- Subject: Event Loop
- Message-ID: <1992Sep1.152720.12544@nic.umass.edu>
- Sender: usenet@nic.umass.edu (USENET News System)
- Nntp-Posting-Host: titan.ucc.umass.edu
- Organization: University of Massachusetts, Amherst
- Date: Tue, 1 Sep 1992 15:27:20 GMT
- Lines: 52
-
- Hello,
-
- I don't know if it is "ok" protocol to post code questions here... I apologize
- in advance for any annoyance I may create. I did check the faq, and it wasn't
- any help.
-
- I am a beginning MAC programmer, and am working with the event loop thingy.
- I am trying to write a simple program which brings up the text window, and
- then just runs through the event loop until you click on the menu bar. But when
- I run it, it just hangs on me, and the debugger says that isEvent is _never_
- true! Will someone enlighten me as to why this code doesn't work? Thanks in
- advance.
-
- begin
-
- repeat
- isEvent := GetNextEvent(everyEvent, thisEvent);
-
- case thisEvent.what of
- nullEvent: {Do nothing}
- begin
- end;
- mouseDown: {where is the mouse clicked?}
- begin
- whereIsIt := FindWindow(thisEvent.where, thisWindow);
-
- case whereisIT of
- 0, 3: {In drawing window}
- gameOver := false;
- 1: {in Menubar}
- gameOver := true;
- end; {case whereIsit}
-
- end; {mouseDown}
-
- otherwise:
- begin
- end;
-
- end; {case thisEvent.What}
- until gameOver;
-
- end.
-
- *=====/=== ===^=====.==='========`============/==== = ^========~====/====^ =-=*
- * "I'll return your fire, if you take away your vultures..." *
- * - Prometheus, gaining leverage *
- *===^==/=======\======= ===`====='===> ==========>====.===== =^=====/====*====*
- Internet Address: rjr@titan.ucc.umass.edu
-
-
-
-