]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/checkbox.cpp
some clean up of the code
[wxWidgets.git] / src / gtk1 / checkbox.cpp
index 43e7b354b04242aeeaa299764772fe676ca9db66..d710aa4fcf49eca330049c202df53c87ddb54468 100644 (file)
@@ -89,3 +89,37 @@ bool wxCheckBox::GetValue(void) const
   return tb->active;
 }
 
+void wxCheckBox::Enable( bool enable )
+{
+  wxControl::Enable( enable );
+  GtkButton *bin = GTK_BUTTON( m_widget );
+  GtkWidget *label = bin->child;
+  gtk_widget_set_sensitive( label, enable );
+}
+
+void wxCheckBox::SetFont( const wxFont &font )
+{
+  if (((wxFont*)&font)->Ok())
+    m_font = font;
+  else
+    m_font = *wxSWISS_FONT;
+  
+  GtkButton *bin = GTK_BUTTON( m_widget );
+  GtkWidget *label = bin->child;
+  
+  GtkStyle *style = (GtkStyle*) NULL;
+  if (!m_hasOwnStyle)
+  {
+    m_hasOwnStyle = TRUE;
+    style = gtk_style_copy( gtk_widget_get_style( label ) );
+  }
+  else
+  {
+    style = gtk_widget_get_style( label );
+  }
+  
+  gdk_font_unref( style->font );
+  style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+  
+  gtk_widget_set_style( label, style );
+}