]> git.saurik.com Git - wxWidgets.git/commitdiff
check whether we show bitmaps at all in GTKUpdateBitmap() (closes #10933)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Jun 2009 22:11:41 +0000 (22:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Jun 2009 22:11:41 +0000 (22:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/button.cpp

index 807facea1c3ebd9e7ec671d75f1e26186638e358..2ce3e1d0a1460bec6ead071c4d8cc4223ce4e520 100644 (file)
@@ -409,9 +409,15 @@ wxButton::State wxButton::GTKGetCurrentState() const
 
 void wxButton::GTKUpdateBitmap()
 {
-    State state = GTKGetCurrentState();
+    // if we don't show bitmaps at all, there is nothing to update
+    if ( m_bitmaps[State_Normal].IsOk() )
+    {
+        // if we do show them, this will return a state for which we do have a
+        // valid bitmap
+        State state = GTKGetCurrentState();
 
-    GTKDoShowBitmap(m_bitmaps[state]);
+        GTKDoShowBitmap(m_bitmaps[state]);
+    }
 }
 
 void wxButton::GTKDoShowBitmap(const wxBitmap& bitmap)