Frame won't Close, Help, Please

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Joshua
Earned a small fee
Earned a small fee
Posts: 18
Joined: Fri Jun 22, 2018 9:23 pm

Frame won't Close, Help, Please

Post by Joshua »

Hello, I have :


wxBEGIN_EVENT_TABLE(MyFrameClass, wxFrame)
EVT_TEXT_ENTER(TEXTENTER, MyFrameClass::OnEnter)
EVT_MENU(Minimal_Quit, MyFrameClass::OnQuit)
EVT_MENU(Minimal_About, MyFrameClass::OnAbout)
EVT_MENU(BUTTON1, MyFrameClass::Onbutton1)
EVT_MENU(BUTTON2, MyFrameClass::Onbutton2)
EVT_MENU(BUTTON3, MyFrameClass::Onbutton3)
EVT_MENU(BUTTON4, MyFrameClass::Onbutton4)
EVT_CLOSE(MyFrameClass::OnCloseWindow)
wxEND_EVENT_TABLE()


The statement : EVT_CLOSE(MyFrameClass::OnCloseWindow)


is giving me a red squiggly under EVT_CLOSE. I am trying to close a frame with the x, and there are three frames total being displayed. I am using Visual Studio and C++ and wxWidgets version 3.1.2

Thank you,
Joshua
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Frame won't Close, Help, Please

Post by doublemax »

What's the signature of MyFrameClass::OnCloseWindow?
It should take a wxCloseEvent as parameter.

And depending on what you do in that method, you need to call event.Skip(), so that the default behavior (the destruction of the frame) is executed.
Use the source, Luke!
Joshua
Earned a small fee
Earned a small fee
Posts: 18
Joined: Fri Jun 22, 2018 9:23 pm

Re: Frame won't Close, Help, Please

Post by Joshua »

A double thank you to you, doublemax. =D>
Post Reply