Code: Select all
void Processing_Monitor_Class::pm_Update_Show (bool Off_or_On)
{
Local_PM_ptr->Show (Off_or_On);
Local_MF_ptr->mf_Set_m_menu_View_X_Page_Check (gdb_Processing_Monitor_Page, Off_or_On);
} // pm_Update_Show
Checking and unchecking the menu item shows and hides the page correctly. Clicking the "cancel" or "close" buttons that are also on the page also works correctly.
But when I close using the "X", and then try to show the page by clicking the menu item, the program hangs. Hangs as in I have to close the program in CodeLite.
I think the problem is that the "X" generates a wxEVT_CLOSE_WINDOW, not a wxEVT_COMMAND_BUTTON_CLICKED (like the menu item and the cancel button event do). If I close the displayed window using the "X", the next time I click the menu item, the program hangs. I don't know why. The pointer to the class is not null.
Or maybe the problem is that wxDialogs and wxFrames behave differently when the X is clicked.
Here is my code.
Code: Select all
void Processing_Monitor_Class::OnClose_Window(wxCloseEvent& event)
{
event.Skip ();
Local_PM_ptr->pm_Update_Show (false);
} // OnClose_Window
Suggestions?
For what it's worth: I use similar code in a wxDialog that operates the same way. The operation works correctly: clicking the X hides the window, and clicking the menu item restores the window.
Interestingly, there IS no wxCloseEvent in the wxDialog.
I dread recreating this page as a wxDialog, because I have two other windows with the same problem that are wxFrames and I'd have to recreate them, too. But I will if I have to.
Colleen
Operating System: Windows 10
Target operating system: Windows 10
CodeLite version 14.0.0
wxCrafter version 2.9
wxWidgets, don't know how to find out what version
MinGw, don't know how to find out what version