New topic: Window.Open fires on close?
<http://forums.realsoftware.com/viewtopic.php?t=37037> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message jm5464 Post subject: Window.Open fires on close?Posted: Tue Jan 11, 2011 7:33 pm Joined: Sun Dec 26, 2010 7:29 pm Posts: 3 I'm pretty new to RB so this is probably just my lack of understanding how something works .. I have a basic app with a main window that's visible on startup and a couple small windows that aren't. I have it set so under certain conditions one of the small windows will open up on startup (it's an info window). I noticed when I close the app (File -> Exit from the main window), that little info window opens up again just before everything closes down. Doing a little debugging I found that it was executing the main window's Open even handler on exit. Through trial and error I found that commenting out one function stops this from happening but inserting a return at the first line of that function doesn't. I also found inserting a Return False in the main window's CancelClose event handler will stop this from happening. Any speculation on why it would execute the Open event handler on close without me actually telling it to? Or why returning false on CancelClose would stop it from happening? Thanks Top timhare Post subject: Re: Window.Open fires on close?Posted: Tue Jan 11, 2011 7:41 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 8894 Location: Portland, OR USA Most likely, you're referring to the window by name, which causes a new instance of the window to open, however briefly, firing the open event. Uncheck the implicit instance property of the main window and the compiler will tell you where the offending code is. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
