X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de97a3b945c99fb942209df48be26f43c1b436d..f4ada568223b79c8a5769cc351c36a8e2ccd7841:/src/gtk1/radiobut.cpp diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index 3cd45f2b8a..a0e789bcbd 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -50,7 +50,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab SetValidator( validator ); - m_widget = gtk_radio_button_new_with_label( NULL, label ); + m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label ); SetLabel(label); @@ -86,4 +86,27 @@ bool wxRadioButton::GetValue(void) const return GTK_TOGGLE_BUTTON(m_widget)->active; } +void wxRadioButton::SetFont( const wxFont &font ) +{ + m_font = 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 ); +}