[futurebasic] More Layer Manager Banter

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: Jamin <benjamen@...>
Date: Wed, 18 Aug 1999 19:43:25 +1000
Sean -G3- said something like:

> However, as Mel said before:
>
> >You can't look for a refresh
> >event or your extension will go crazy. Consider Apple does about 3000
> >FN FRONTWINDOWS a second, and window updates after checking the valid
> >region of the window and you don't want to do it this way.

I do this at the moment in an app, it works fine even on a 68000 LC.  Here is the code I use (Based on Mars's shell):


CLEAR LOCAL
LOCAL FN GetWindowName$(theWindowPtr&)
  ' Err on the side of caution with these pointers...
  POKE @myTitle$,0
  LONG IF theWindowPtr& > 0
    TitleHandle& = theWindowPtr&.wTitleHandle&
    LONG IF TitleHandle& <> 0
      DeReffed& = [TitleHandle&]
      LONG IF DeReffed& > 0
        BLOCKMOVE DeReffed&,@myTitle$, PEEK(DeReffed&)+1
      END IF
    END IF
  END IF
END FN = myTitle$


LOCAL
LOCAL FN jGNEeventhandler(eventRec&)
  LONG IF eventRec&.Evtnum% > 0
    LONG IF eventRec&.Evtnum% = _Updatevt
      theLayerWindow&  = eventRec&.Evtmessage&
      LayerWindowName$ = FN GetWindowName$(theLayerWindow&)
      LONG IF LayerWindowName$ = gCatchName$
         ' Do you stuff here...
      END IF
    END IF
  END IF
END FN

>
> Also, I know that one of the applications I am playing with makes windows
> while in the background. So, _currApName might not return the application
> which created the window.
>

It dosen't matter, when the window is finally displayed, it causes a _Updatevt to be posted, and the application that does it is always the _currApName , even if it is not the CurrentFrontProcess.  The two are very different, _currApName is who is executing code at that moment, CurrentFrontProcess is the guy who is the top-most/front-most app.

> In this entire _planet_, you are the only person I
> can find who has worked with (and released) information about the Layer
> Manager. Good work.

Apple doesn't like developers promoting use of the Layer Manager, but as long as there is no clean alternative, I feel justified in promoting selective use of it.  I am awaiting the men in suits knocking at my door, asking me to shut down my web-site.  I could name 20 or so Shareware INITs that use the Layer Manager.

> However, I think Apple has to get around to officially releasing the
> Layer Manager... Does anyone know a way to get in contact with an Apple
> representative who would be able to respond to these inquiries?

If you spin around three times clockwise and yell "Otto, are you out there?", then Otto the magical Apple employee will appear and help you find the right person to talk to.  He lurks on the list and always seems to be listening...

Jamin