X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d968078adbfb147e913b9a33fc54242a36f117ce..e8fd252ef87d8ff6409d405218ff02c91b980e0a:/src/gtk/radiobut.cpp diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index 649a520830..9cb0c7fe16 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -47,8 +47,6 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r // wxRadioButton //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl) - bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label, @@ -66,7 +64,7 @@ bool wxRadioButton::Create( wxWindow *parent, } GSList* radioButtonGroup = NULL; - if (!HasFlag(wxRB_GROUP)) + if (!HasFlag(wxRB_GROUP) && !HasFlag(wxRB_SINGLE)) { // search backward for last group start wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast(); @@ -83,11 +81,12 @@ bool wxRadioButton::Create( wxWindow *parent, } m_widget = gtk_radio_button_new_with_label( radioButtonGroup, wxGTK_CONV( label ) ); + g_object_ref(m_widget); SetLabel(label); - g_signal_connect (m_widget, "clicked", - G_CALLBACK (gtk_radiobutton_clicked_callback), this); + g_signal_connect_after (m_widget, "clicked", + G_CALLBACK (gtk_radiobutton_clicked_callback), this); m_parent->DoAddChild( this ); @@ -100,6 +99,9 @@ void wxRadioButton::SetLabel( const wxString& label ) { wxCHECK_RET( m_widget != NULL, wxT("invalid radiobutton") ); + // save the original label + wxControlBase::SetLabel(label); + GTKSetLabelForLabel(GTK_LABEL(GTK_BIN(m_widget)->child), label); } @@ -137,11 +139,14 @@ bool wxRadioButton::GetValue() const bool wxRadioButton::Enable( bool enable ) { - if ( !wxControl::Enable( enable ) ) + if (!base_type::Enable(enable)) return false; gtk_widget_set_sensitive(GTK_BIN(m_widget)->child, enable); + if (enable) + GTKFixSensitivity(); + return true; }