[futurebasic] Re: [FB] Re: Layer Manager

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

From: Sean -G3- <mclaugh@...>
Date: Tue, 17 Aug 99 13:45:37 -0400
>Does the Layer Manager even exist in MacOS 8.6? I seem to recall seeing 
>somewhere that it does not. So your program may not even work under 8.6 at 
>all. (And I don't believe the Layer Manager is implemented in mac.app, the 
>MacOS compatability environment for Mac OS X.)

Ok, I just heard from Jamin. The Layer Manager is definately different 
from the process manager. However, they Layer Manager never _was_ 
supported or documented. Its something Apple uses for themselves:

>Remember, _not_ discontinued, it was an X-File
>to start with.  A Window record is a Layer record. The
>specific layer data (PSN etc) lives in the refcon field.


>The Layer Manager was never dropped by Apple because it never exisited, it 
>is just what Apple themselves used to do tricky stuff.

Here is his non-layer-manager solution:

>I suggest you look for the window that you want to 'fiddle' with by using 
>the jGNE code.  Just look for a WindowRefresh event, grab the Window 
>pointer from the event record, and peek a look at its title/name.  If its 
>"Untitled 1", and the _currApName contains "SimpleText", then you are 
>probarly safe to send it a Window Close message.

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.

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 sounds like I'll have to _manually_ load the Layer Manager DCOD or 
I'll have to make a faceless background application to use the DCOD. And, 
from Jamin's description, loading a DCOD in an extension _is_ quite 
difficult. Further, the Layer Manager seems to be the _only_ way to 
directly link a window to its creator.

Mark Goodes has suggested that a window can be linked to its creator by 
trapping it _as_ it is created. I'm still checking with him on this. Any 
successful code will be open-sourced... (providing I O.K this with people 
who have sent me code.)