]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/checkbox.cpp
don't call SelectObject() twice in SetBrush() nor SetFont() neither
[wxWidgets.git] / src / gtk / checkbox.cpp
index c49c46ccff7f50aa87145e35bf9fc261cfdbdab1..2a7d0437bf6b44c4c240e42a8f7ca642c2b22e0f 100644 (file)
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checkbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CHECKBOX
@@ -118,8 +121,7 @@ bool wxCheckBox::Create(wxWindow *parent,
     m_parent->DoAddChild( this );
 
     PostCreation();
-
-    SetFont( parent->GetFont() );
+    InheritAttributes();
 
     wxSize size_best( DoGetBestSize() );
     wxSize new_size( size );
@@ -130,9 +132,6 @@ bool wxCheckBox::Create(wxWindow *parent,
     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;
@@ -220,7 +219,8 @@ void wxCheckBox::OnInternalIdle()
         }
     }
     
-    UpdateWindowUI();
+    if (wxUpdateUIEvent::CanUpdate(this))
+        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
 wxSize wxCheckBox::DoGetBestSize() const