and checked for NULL in one of the event handlers, since
on the Mac the event handler may be called before the
control is properly initialized
Tested for an empty string in Mac's textctrl.cpp
else we get a crash if there is nothing in the text control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15555
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxImageList *imaglist)
: WidgetsPage(notebook)
{
wxImageList *imaglist)
: WidgetsPage(notebook)
{
+ m_chkVert = NULL;
+ m_chkWrap = NULL;
+ m_spinbtn = NULL;
+ m_spinctrl = NULL;
+ m_textValue = NULL;
+ m_textMin = NULL;
+ m_textMax = NULL;
imaglist->Add(wxBitmap(spinbtn_xpm));
// init everything
imaglist->Add(wxBitmap(spinbtn_xpm));
// init everything
void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event)
{
void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event)
{
+ if (!m_spinctrl)
+ return;
int value = event.GetInt();
wxASSERT_MSG( value == m_spinctrl->GetValue(),
int value = event.GetInt();
wxASSERT_MSG( value == m_spinctrl->GetValue(),
wxLogMessage(_T("Spin control value changed, now %d"), value);
}
wxLogMessage(_T("Spin control value changed, now %d"), value);
}
-#endif
\ No newline at end of file
else
{
actualsize = GetHandleSize( theText ) ;
else
{
actualsize = GetHandleSize( theText ) ;
- strncpy( wxBuffer , *theText , actualsize ) ;
+ if (actualsize != 0)
+ strncpy( wxBuffer , *theText , actualsize ) ;
DisposeHandle( theText ) ;
}
}
DisposeHandle( theText ) ;
}
}
else
{
actualsize = GetHandleSize( theText ) ;
else
{
actualsize = GetHandleSize( theText ) ;
- strncpy( wxBuffer , *theText , actualsize ) ;
+ if (actualsize != 0)
+ strncpy( wxBuffer , *theText , actualsize ) ;
DisposeHandle( theText ) ;
}
}
DisposeHandle( theText ) ;
}
}