X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a01bb1bce4aedbbdb6b705b0fababd01b918cb0..130d96dcf64bcade6fb6b9da49ee9983ed9872ef:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 12716ffeb5..e9bbcc1ad5 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -844,6 +844,12 @@ void wxTextCtrl::GetSelection(long* from, long* to) const bool wxTextCtrl::IsEditable() const { + // strangely enough, we may be called before the control is created: our + // own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls + // us + if ( !m_hWnd ) + return TRUE; + long style = ::GetWindowLong(GetHwnd(), GWL_STYLE); return (style & ES_READONLY) == 0;