|
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
1. wxMDIChildFrame problem #2556 Posted by: 2003-08-25 22:36:08 |
When i click an event to open a new window, but, the program crashed, prompt me "Bugs report etc..".
then, the program will be force closing by window.
My testing evironment is on Window XP
void MyFrame::OnNewWindow(wxCommandEvent & WXUNUSED(event)) {
MyChildWindow *subframe = new appChildWindow(frame, _T("Test New Window"), wxPoint(-1, -1), wxSize(-1, -1), wxDEFAULT_FRAME_STYLE);
subframe->SetTitle("A"); subframe->Show(TRUE); }
could somebody tell me what happen?
Thank you. |
2. Re: wxMDIChildFrame problem #2571 Posted by: 2003-08-28 03:34:02 |
Looks like the problem is inside appChildWindow constructor. Can you post its code? |
3. Re: wxMDIChildFrame problem #2579 Posted by: 2003-08-30 20:17:34 |
hi, sorry, busy these few days. You means, post whole source code?
Thank you. |
4. Re: wxMDIChildFrame problem #2604 Posted by: Ktirf 2003-09-06 21:55:31 |
The whole code of appChildWindow constructor. |
5. Re: wxMDIChildFrame problem #2619 |
Hi, sorry for lately reply, becuase my computer is going down these few days...
below is my appChildWindow constructor
class appChildWindow: public wxMDIChildFrame { public: appChildWindow(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); ~appChildWindow();
};
thank youMeow~ |
6. Re: wxMDIChildFrame problem #2620 Posted by: Ktirf 2003-09-13 22:34:35 |
Now that's great :) I thought it was clear that the definition of the constructor is needed, not the declaration. I want to see, what does this constructor do. |
7. Re: wxMDIChildFrame problem #2621 |
just want to create a child frame.
this child frame no have any event to be declare, just a simple child window
but, doing failed.. :(
Meow~ |
8. Re: wxMDIChildFrame problem #2622 Posted by: Ktirf 2003-09-14 02:41:18 |
Could you please dump the body of the constructor, line by line! Ain't it so hard? Like this:
appChildWindow::appChildWindow() :
wxMDIChildFrame()
{
}
Most likely, the error is inside appChildWindow, but I'm not a magician to guess where exactly.
By the way - is MyFrame derived from wxMDIParentFrame? |
9. Re: wxMDIChildFrame problem #2623 |
Hi, is that this one?
appChildWindow::appChildWindow(wxMDIParentFrame *parent, const wxString& title,
const wxPoint& pos, const wxSize& size,
const long style)
: wxMDIChildFrame(parent, -1, title, pos, size,
style | wxNO_FULL_REPAINT_ON_RESIZE){
my_children.Append(this);
SetSizeHints(100, 100);
}
appChildWindow::~appChildWindow(){
my_children.DeleteObject(this);
}
Meow~ |
10. Re: wxMDIChildFrame problem #2625 Posted by: Ktirf 2003-09-14 15:34:31 |
Yes, that's it, great :) But, unfortunately, the problem is still isn't clear :( Let's dig furhter. Do I understand it right, that my_children is a wxList or wxObjArray object and it is global? |
11. Re: wxMDIChildFrame problem #2626 |
my_children is wxList, global variable
Meow~ |
12. Re: wxMDIChildFrame problem #2627 Posted by: Ktirf 2003-09-14 17:05:02 |
Next guess. Is 'frame' variable properly initialized before calling MyFrame::OnNewFrame? And, by the way, what is the class MyFrame derives from and what is the type of 'frame'? Is 'frame' just another name for 'this'? |
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |