Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!bpa!cbmvax!vu-vlsi!swatsun!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: MultiFinder questions Message-ID: <2665@carthage.cs.swarthmore.edu> Date: 11 Apr 89 01:35:53 GMT References: <42072@csvax1.cs.tcd.ie> Reply-To: jackiw@carthage.UUCP (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 53 In article <42072@csvax1.cs.tcd.ie> fmodwyer@csvax1.cs.tcd.ie (Frank O'Dwyer, Dept. of Computer Science, TCD, Dublin 2, IRELAND) writes: > 1. When can an application background under MF? i.e., when is it > O.K. to set the 'Can Background' bit in the MF SIZE resource? Anytime. CanBackground really only seems to be used to determine whether the application should get null events while it's in the background (on which it should "process-one-null-event's-worth"). It'll get update events for its windows regardless of whether it CanBackground or not. > 2. What does an application have to do to be 'MultiFinder Aware'? You should understand suspend and resume events (which are both appl4 events; Suspend has bit#0 of theEvent.message clear; Resume has bit#0 set. What does it mean to "understand" these events? Two things: you should deactivate your topmost window, get rid of all hi-liting, etc. Second, if you keep the content of the clipboard in some private format (instead of using the actual DeskScrap), for efficiency's sake lets say, and actually put it onto the deskScrap only when User asks for a desk accessory or quits (intending, presumably, to PASTE it into some application which doesn't parse your internal format), then you want to normalize your scrap (convert to desk scrap) on suspend. Resume requires only reactivation of the window, generally speaking. If you don't set Multifinder Aware, Multifinder goes through a long song-and-dance of trying to convince your application that it's about to see a desk accessory (based on the assumption that your app will respond in more or less the ways outlined in the previous paragraph). > I ask because I've written a program which seems to background fine > under MF - even though I've set 'MultiFinder Aware' to false, > and set 'Can Background' to true - *without* making the slightest > provision in my code to handle backgrounding. Is this O.K. or > is my program doomed to crash under some wierd set of circumstances? Your program is merrily getting null events (canBackground), which I assume it interprets as a signal to do-some-more-processing. Fine, you won't crash. Adding code to understand Suspend&Resume events, and then setting MultiFinderAware, will speed up your program's response to being switched out. If it seems to work fine now, you probably don't need to worry about being (technically) MultifinderAware. > -- > Frank O'Dwyer, e-mail: FMODWYER@cs.tcd.ie > Dept. of Computer Science, > Trinity College Dublin, > IRELAND. -- _ _|\____ Nick Jackiw | Visual Geometry Project | Math Department / /_/ O> \ ------------+-------------------------+ Swarthmore College | O> | 215-328-8225| jackiw@cs.swarthmore.edu| Swarthmore PA 19081 \_Guernica_/ ------------+-------------------------+ USA