[comp.sys.mac.programmer] MacApp/System 7 question and Background app summary

wilkins@jarthur.claremont.edu (08/14/90)

First my new question:  I'm using the UDialog unit in MacApp to create a
dialog and used the techniques from the AppleEvent-capable DemoText
application on the System 7 disc to handle AppleEvents.

Problem:  If I get an AppleEvent which causes a window to open, my app sends
it on its merry way even if a dialog is open, leading to an obscured
dialog.  Since I have used UDialog for a dialog which opens at startup, and
the app wants to open an untitled doc at startup, the dialog winds up BEHIND
the document.  Quite a mess.

  So, I thought I'd just get the window to open behind the dialog.  Wrongo,
monkey brain, as my mother used to say...  there seems to be no way to
coerce a window into opening behind another window except overriding
TWindow, which I shouldn't have to do.  I tried setting the dialog's fFloats
field to TRUE but that made the thing blow chunks.

  Is there an easy way to either put off receiving AppleEvents while a
dialog is up or open a window behind the dialog?  Or do I have to keep
trying things until something works?

  By the way, does MacApp itself use TDialogView?  If I subclass it to
somehow take care of this problem will I still have trouble with existing
dialogs?

  Chew on that for a while.  Anyway, here's the summary:

--------------------------------

  About a week and a half ago I posted asking about background applications
and how to write them.

  The best help I got was from Lunarmobiscuit, one Matthew (?) Libes from
CMU.  He is the author of "Darkness," a background app which functions as a
screen saver.

  Anyway, the fundamental rule seems to be that if you have to call
InitWindows then your bg-only app isn't.  Apparently as long as you only
draw into offscreen buffers (or if you break the rules :-) you CAN use
QuickDraw, good for some graphics server operations.

  bg-only apps are double-clickable and set-startupable :-) like any other,
but under 6.0.5 you have no indication either in "About the Finder" or in
the finder window itself that a given bg-only app is running.  These
problems are fixed in System 7.