X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fab591c5cceff41c0bedaa89af34cd039e2c44e1..5c526007a8909e8856a6d1fb656c5150738d2e4a:/src/gtk/tglbtn.cpp

diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp
index 2a913203a7..d6f4d5881f 100644
--- a/src/gtk/tglbtn.cpp
+++ b/src/gtk/tglbtn.cpp
@@ -10,6 +10,9 @@
 // License:     Rocketeer license
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/tglbtn.h"
 #include "wx/button.h"
 
@@ -72,8 +75,7 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
    m_parent->DoAddChild(this);
 
    PostCreation();
-
-   SetFont(parent->GetFont());
+   InheritAttributes();
 
    wxSize size_best(DoGetBestSize());
    wxSize new_size(size);
@@ -84,9 +86,6 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
    if ((new_size.x != size.x) || (new_size.y != size.y))
       SetSize(new_size.x, new_size.y);
 
-   SetBackgroundColour(parent->GetBackgroundColour());
-   SetForegroundColour(parent->GetForegroundColour());
-
    Show(TRUE);
 
    return TRUE;
@@ -166,7 +165,8 @@ void wxToggleButton::OnInternalIdle()
         gdk_window_set_cursor(win, cursor.GetCursor());
     }
 
-    UpdateWindowUI();
+    if (wxUpdateUIEvent::CanUpdate(this))
+        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
 // wxSize DoGetBestSize() const