I’m constructing a UI using wxWidgets.
In my GUI, I generate a window (wxFrame class) which is accessible through pushing a bitmap button. In that window, I also perform some tasks, again pushing some bitmap buttons and diabling them etc. But I can’t close and reopen that window with the state saved. I always have to re-initialize it, and this is very impractical.
How can I save the state of my window? I checked the internet, it’s suggested to use wxPersistent class but this class is missing in my wxWidgets.
Thank you for any help,
Best Regards.
Instead of destroying the window every time, you can just hide it with the
wxWindow::Show()member function, passingfalseas the argument, when you receive awxCloseEvent. You then veto thewxCloseEventto prevent WxWidgets from destroying your window:This should remove it from the screen, but all the initialized parts should still be there. If you need to show it again, call the
Show()method again withtrue.