From a dialog i call the wxImagePanel to see a picture (https://wiki.wxwidgets.org/An_image_panel). When dlg->Show(false) disappear, and then close the image frame, in destructor i must say dlg->Show() and all are ok. But when from other object type i call wxImagePanel, now other object must Show.
How to tell destructor to Show the object that call wxImagePanel? Thank's
Jim.
*I know that is easy, but now i am learning all that.
Code: Select all
dlg->Show(false);
wxFrame *frame;
wxImagePanel * drawPane;
wxInitAllImageHandlers();
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
frame = new wxFrame(NULL, wxID_ANY, thefile, wxPoint(50,50), wxSize(800,600));
drawPane = new wxImagePanel(frame,thefile);
sizer->Add(drawPane, 1, wxEXPAND);
frame->SetSizer(sizer);
frame->Show();
class wxImagePanel : public wxPanel
{
wxImage image;
wxBitmap resized;
int w, h;
public:
wxImagePanel(wxFrame* parent, wxString file);
~wxImagePanel();
............
wxImagePanel::~wxImagePanel()
{
dlg->Show();
}