Ok, I see what you are saying. You need to capture the 'closeWindow'
event, so to speak and use that to 'forget' the instance of the MIAW.
Unfortunately, short of making your OWN toolbar and buttons, I don't
know a way of getting this exact functionality.

I believe having the window 'forget' itself is what causes Director to
reference a chunk of memory that has already been cleared, so that is
why something not connected to the MIAW needs to get rid of it...someone
let me know if I am misinformed.

Kristian, how many MIAW's do you open at once? Keep in mind you can make
one window, "popup" for example, and have lots of different content
inside that one container. Is it necessary to forget it every time, or
can you get away with just changing the content and size?

Here's a little brainstorm: Maybe you can have a routine that adds a
window to an "openedWindow" list and periodically checks to see which
ones are still open. If not, forget them....like a MIAW garbage
collection system. It wouldn't need to operate if nothing was in the
list, which could make it a bit more efficient.

This may help get around the lack of a 'closeWindow' event and shouldn't
be TOO much work with a few timeouts and a function or two.

~Mathew



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kristian
Sent: Tuesday, August 19, 2003 2:16 PM
To: [EMAIL PROTECTED]
Subject: RE: <lingo-l> Projector vs. external cast - BUT MIAW...


Further down...

> > I am not calling it since the documentation stated that it is
> > a system handler and gets executed when I close a window 
> > using the window's close box. Any suggestions?
> 
> Indeed. You need to explicitly forget the MIAW.
> 
> It's a bit more involved than it appears. You can't have the 
> MIAW forget itself, and you can't tell the stage to forget 
> the MIAW. Both are calls the MIAW makes, and a call must 
> return. When it tries to return, though, the MIAW is gone. 
> *Kablooie* is the technical term for what happens next.
> 
> One method a lot of people use is to have a global in the 
> stage movie, something like this.
> 
> global gCloseMiaw
> 
> on prepareMovie
>   gCloseMIAW = FALSE
>   yada yada
> End
> 
> Then in a periodical, like a frame handler:
> 
> global gCloseMiaw
> 
> on exitFrame
>   if gCloseMiaw = TRUE then
>      close gMQTWin
>      forget gMQTWin
>      gCloseMiaw  = FALSE
>   end if
> end
> 
> Then your MIAW would cause itself to be closed with something 
> like this:
> 
> tell the stage
>   gCloseMiaw = TRUE
> end tell

OK, I can follow this... But the tell the stage handler has to be in a
preiodical or?? What I need is to capture the close event that gets
triggered when the user uses the close box in the title bar... Possible?

Would of cause be glad to do it your way but not sure I can figure that
out
quite yet without som explanation on how you call the handlers... I
assume
they are in the stage movie?

Thanks a bunch
/Kristian

> I actually use a little different method so I'm not stuck 
> with a frame handler. Here's the way I do it:
> 
> global gMIAWTimeOut
> 
> on CloseModalDLOG gOkPressed
>   if not voidP(window gMQTWin) then
>     -- always assign a timeout to a variable
>     -- or you'll get a memory leak
>     gMIAWTimeOut = timeOut(gMiawName).new(50, #mForgetWindow, VOID)
>   end if
> end
> 
> on mForgetWindow 
>   lWindowName = gMIAWTimeOut .name
>   if not voidP(window lWindowName) then
>     window(lWindowName).forget()
>     gMiawName = VOID
>   end if
>   gMIAWTimeOut .target = VOID
>   gMIAWTimeOut .forget()
>   gMIAWTimeOut = VOID 
> end
> 
> Hope that helps.
> 
> Cordially,
> 
> Kerry Thompson
> 
> [To remove yourself from this list, or to change to digest 
> mode, go to http://www.penworks.com/lingo-l.cgi  To post 
> messages to the list, email [EMAIL PROTECTED]  (Problems, 
> email [EMAIL PROTECTED]). Lingo-L is for learning and 
> helping with programming Lingo.  Thanks!]
> 



[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to