I am playing around with using "Generate event procedures" for automatic event procedure generation, with two forms:
A simple program loop works fine for programs with one window:
Code: Select all
Repeat
event = WaitWindowEvent()
Until Window_1_Events(event) = #False ;Window_1 is the main form
But after the app shows the subwindow (called Window_Editor), via "OpenWindow_Editor()", closing the subwindow will end the entire program, and not just the subwindow. I am guessing that closing the subwindow is somehow triggering "Window_1_Events(event) = #False", and thereby ending the loop, but the mechanics of the event handling here are not clear to me.
What is the best way to handle the closing of a subwindow correctly, assuming that I want to use PureBasic's automatic event procedure generation?