]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/tbargtk.cpp
use wxColourDatabase::Find() instead of deprecated FindColour(); some minor code...
[wxWidgets.git] / src / gtk1 / tbargtk.cpp
index 0802257cccd7838b698a96beb86cec5f99d68cdb..4755e17a0e16c75c2aca7d42daf8d82f878bd9ff 100644 (file)
@@ -184,7 +184,22 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
         }
     }
 
-    tbar->OnLeftClick( tool->GetId(), tool->IsToggled() );
+    if( !tbar->OnLeftClick( tool->GetId(), tool->IsToggled() ) && tool->CanBeToggled() )
+    {
+        // revert back
+        tool->Toggle();
+
+        wxBitmap bitmap = tool->GetBitmap();
+        if ( bitmap.Ok() )
+        {
+            GtkPixmap *pixmap = GTK_PIXMAP( tool->m_pixmap );
+
+            GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap()
+                                               : (GdkBitmap *)NULL;
+
+            gtk_pixmap_set( pixmap, bitmap.GetPixmap(), mask );
+        }
+    }
 }
 
 //-----------------------------------------------------------------------------