home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!gateway
- From: fonion@st-anns.ICS.UCI.EDU
- Subject: multifinder switching
- Message-ID: <9209031818.aa13404@Paris.ics.uci.edu>
- Newsgroups: comp.sys.mac.programmer
- Lines: 70
- Date: 4 Sep 92 01:22:26 GMT
-
- Hi -
- I'm having a problem getting my application to switch under
- multifinder by clicking the small icon in the upper righthand corner.
- I have read through Apple's 'Programmer's guide to multifinder,' and
- even modeled my event loop after their sample code, but my application
- still won't switch. This is happening under system 6.0.7, but the problem
- also occurs under 7.0. It does switch by selecting another program
- from the apple menu.
- I have also noticed that the program does not switch when I
- click in the window of another program. I thought that this would be
- handled by calling SystemClick(), but it doesn't seem to be working.
- I'm including the relevant parts of my event loop in the hopes
- that some kind soul will enlighten me as to what I am doing wrong.
- Incidentally, I'm using Think C 5.0.
-
- Thanks in advance,
- Fritz Onion (fonion@ics.uci.edu)
-
-
- /* Event handler */
-
- switch (gTheEvent.what) {
- case nullEvent:
- HandleNull();
- break;
- case mouseDown:
- HandleMouseDown(1);
- break;
- case keyDown:
- case autoKey:
- theChar = gTheEvent.message & charCodeMask;
- if ((gTheEvent.modifiers & cmdKey) != 0)
- HandleMenuChoice(MenuKey(theChar));
- break;
- case updateEvt:
- window = (WindowPtr)gTheEvent.message;
- BeginUpdate(window);
- <my update done here>
- EndUpdate(window);
- break;
- case activateEvt:
- window = (WindowPtr)gTheEvent.message;
- if ((gTheEvent.modifiers & activeFlag) != 0)
- SelectWindow(window);
- break;
- }
-
-
- /* Handle mouse down events */
-
- HandleMouseDown(menu_active)
- {
- WindowPtr whichWindow;
- short int thePart;
- long int menuChoice, windSize;
-
- thePart = FindWindow(gTheEvent.where, &whichWindow);
- switch(thePart) {
- case inMenuBar:
- if (menu_active) {
- menuChoice =
- MenuSelect(gTheEvent.where);
- HandleMenuChoice(menuChoice);
- }
- break;
- case inSysWindow:
- SystemClick(&gTheEvent, whichWindow);
- break;
- }
- }
-