> 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

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!]

Reply via email to