Don't crash when creating wxStaticBox in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Jul 2013 21:54:53 +0000 (21:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Jul 2013 21:54:53 +0000 (21:54 +0000)
commit94e1ee1b4d4050fa04e3688a21ed0b1693a0b456
tree89d750f0e6f8a9e0ea97e6e8188502ed1fd509f5
parentb0ae60498d2a1cab6cff09d425d235a0847135e8
Don't crash when creating wxStaticBox in wxGTK.

Since r74585, wxWindow::SetCanFocus() is called from wxStaticBoxBase ctor,
i.e. before the real window is created, and this results in a crash in wxGTK
where SetCanFocus() needs a valid widget.

Fix this simply by doing nothing in SetCanFocus() if the widget is not created
yet as this should result in the same behaviour as before r74585. This doesn't
seem like the right thing to do, however, and we should probably remove this
call from wxStaticBoxBase ctor and do it in wxStaticBox implementation itself
instead.

Closes #15358.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/gtk/window.cpp