X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c67daf87774c71ae9f73af9969008af220e52a11..32e9da8bfaafe4f462f7473a7e11e3387847e121:/src/gtk1/radiobut.cpp diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index 321210ec3d..a9a81ed5ab 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -86,4 +86,38 @@ bool wxRadioButton::GetValue(void) const return GTK_TOGGLE_BUTTON(m_widget)->active; } +void wxRadioButton::Enable( bool enable ) +{ + wxControl::Enable( enable ); + GtkButton *bin = GTK_BUTTON( m_widget ); + GtkWidget *label = bin->child; + gtk_widget_set_sensitive( label, enable ); +} + +void wxRadioButton::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 ); +}