| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. close the frame from the panel #4425 Posted by: 2004-06-11 17:42:21 | Hi,
I have a general problem with access on my objects. the situation: I have one mail frame (one class) with panel (Another class), from the button of this panel I cool another help-frame ( (a new class) the first staes visible). In this second frame I have inside a panel of type Another. Now I'like to close this help-frame from botton on the panel. the problem - runtime error.
class Adresse: public wxFrame{ public: Adresse(const wxString& title, const wxPoint& pos, const wxSize& size); Adresse::~Adresse(){} };
class MyPanel: public wxPanel{ public: MyPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size); MyPanel::~MyPanel(){} void OnAdressePers(wxCommandEvent& event); // to cool the help frame:adresse void OnQuitUF(wxCommandEvent& event); protected: Adresse *frameAdr; ........
void MyPanel::OnAdressePers(wxCommandEvent& WXUNUSED(event)){ frameAdr = new Adresse("KATALOG Adresse", wxPoint(250, 150), wxSize(500, 500)); frameAdr->Show(TRUE); }
void MyPanel::OnQuitUF(wxCommandEvent& WXUNUSED(event)){ frameAdr->Close(TRUE); // runtime error }
thanks! | 2. Re: close the frame from the panel #4426 Posted by: upCASE 2004-06-11 20:06:27 | Hi! Have you tried catching the button event in the frame? If you set the panel as parent for the button and the frame as parent for the panel, the event should propagate through the panel to the frame. Then, close the frame...
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|