fixed crash in OnSize() handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-10-10 00:11:23 +00:00
parent 16d38102e8
commit 268766dd1f

View File

@@ -253,6 +253,7 @@ MyFrame::MyFrame()
: wxFrame((wxFrame *)NULL, -1, "wxWindows menu sample", : wxFrame((wxFrame *)NULL, -1, "wxWindows menu sample",
wxDefaultPosition, wxSize(300, 200)) wxDefaultPosition, wxSize(300, 200))
{ {
m_textctrl = NULL;
m_menu = NULL; m_menu = NULL;
m_countDummy = 0; m_countDummy = 0;
m_logOld = NULL; m_logOld = NULL;
@@ -701,6 +702,9 @@ void MyFrame::OnRightUp(wxMouseEvent &event)
void MyFrame::OnSize(wxSizeEvent& event) void MyFrame::OnSize(wxSizeEvent& event)
{ {
if ( !m_textctrl )
return;
// leave a band below for popup menu testing // leave a band below for popup menu testing
wxSize size = GetClientSize(); wxSize size = GetClientSize();
m_textctrl->SetSize(0, 0, size.x, (3*size.y)/4); m_textctrl->SetSize(0, 0, size.x, (3*size.y)/4);