IonicWind Software

IWBasic => GUI Central => Topic started by: Jerry Muelver on February 27, 2008, 05:04:10 PM

Title: Action before @IDCLOSEWINDOW
Post by: Jerry Muelver on February 27, 2008, 05:04:10 PM
I have a "clean up dirty file" routine I use when the user chooses "Quit" from the menu. I want to plug that same routine into action when the user clicks on the "X" in the corner of the window to quit, instead of using the menu.

case @IDCLOSEWINDOW
IF dirtyfile = 1 then GOSUB doDirtyFile
run = 0


Doesn't work. I'm guessing that's because the window is already closed by the time the @IDCLOSEWINDOW message hits the loop. Any suggestions to fix, or workaround?
Title: Re: Action before @IDCLOSEWINDOW
Post by: LarryMc on February 27, 2008, 05:24:37 PM
See what @IDDESTROY does.

Larry
Title: Re: Action before @IDCLOSEWINDOW
Post by: Jerry Muelver on February 27, 2008, 06:18:30 PM
Thanks, Larry. I can put this puppy to bed, now!
Title: Re: Action before @IDCLOSEWINDOW
Post by: Ionic Wind Support Team on February 27, 2008, 08:11:42 PM
Should work fine, of course.  The X in the title bar sends the @IDCLOSEWINDOW message, so the window is never closed unless you are actually calling the CloseWindow command.