X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abdeb9e7006488bf917d90048fcd0cbe22f44a71..b40a9d371f0e89e2e43c5d6ec440fefcd3d1a434:/src/gtk1/radiobut.cpp diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index 1fd39b77fb..9900eb7c89 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -40,6 +40,7 @@ extern wxWindowGTK *g_delayedFocus; // "clicked" //----------------------------------------------------------------------------- +extern "C" { static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *rb ) { @@ -58,6 +59,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r event.SetEventObject( rb ); rb->GetEventHandler()->ProcessEvent( event ); } +} //----------------------------------------------------------------------------- // wxRadioButton @@ -187,11 +189,10 @@ bool wxRadioButton::Enable( bool enable ) return TRUE; } -void wxRadioButton::ApplyWidgetStyle() +void wxRadioButton::DoApplyWidgetStyle(GtkRcStyle *style) { - SetWidgetStyle(); - gtk_widget_set_style( m_widget, m_widgetStyle ); - gtk_widget_set_style( BUTTON_CHILD(m_widget), m_widgetStyle ); + gtk_widget_modify_style(m_widget, style); + gtk_widget_modify_style(BUTTON_CHILD(m_widget), style); } bool wxRadioButton::IsOwnGtkWindow( GdkWindow *window ) @@ -233,4 +234,19 @@ wxSize wxRadioButton::DoGetBestSize() const return wxControl::DoGetBestSize(); } +// static +wxVisualAttributes +wxRadioButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + wxVisualAttributes attr; + // NB: we need toplevel window so that GTK+ can find the right style + GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL); + GtkWidget* widget = gtk_radio_button_new_with_label(NULL, ""); + gtk_container_add(GTK_CONTAINER(wnd), widget); + attr = GetDefaultAttributesFromGTKWidget(widget); + gtk_widget_destroy(wnd); + return attr; +} + + #endif