X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b26b60fac70f89cf33935f78469e27536d8b614..1e52188741389278cd99abf79218162c87024ba3:/src/mac/scrolbar.cpp diff --git a/src/mac/scrolbar.cpp b/src/mac/scrolbar.cpp index eef2a84c54..5ddda761a0 100644 --- a/src/mac/scrolbar.cpp +++ b/src/mac/scrolbar.cpp @@ -40,24 +40,25 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - if (!parent) - return FALSE; - + if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) + return FALSE; + Rect bounds ; Str255 title ; - + MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100, - kControlScrollBarLiveProc , (long) this ) ; - + m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) , + &bounds , title , true , 0 , 0 , 100, + kControlScrollBarLiveProc , (long) this) ; + wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; MacPostControlCreate() ; - return TRUE; + return TRUE; } wxScrollBar::~wxScrollBar()