diff --git a/include/wx/gtk/radiobut.h b/include/wx/gtk/radiobut.h index a44f13ed82..9a54dffa62 100644 --- a/include/wx/gtk/radiobut.h +++ b/include/wx/gtk/radiobut.h @@ -51,7 +51,6 @@ public: virtual bool IsRadioButton() const { return TRUE; } - GSList *m_radioButtonGroup; void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow( GdkWindow *window ); void OnInternalIdle(); diff --git a/include/wx/gtk1/radiobut.h b/include/wx/gtk1/radiobut.h index a44f13ed82..9a54dffa62 100644 --- a/include/wx/gtk1/radiobut.h +++ b/include/wx/gtk1/radiobut.h @@ -51,7 +51,6 @@ public: virtual bool IsRadioButton() const { return TRUE; } - GSList *m_radioButtonGroup; void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow( GdkWindow *window ); void OnInternalIdle(); diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index d6440f577a..9d0f498fae 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -83,12 +83,8 @@ bool wxRadioButton::Create( wxWindow *parent, return FALSE; } - if (HasFlag(wxRB_GROUP)) - { - // start a new group - m_radioButtonGroup = (GSList*) NULL; - } - else + GSList* radioButtonGroup = NULL; + if (!HasFlag(wxRB_GROUP)) { // search backward for last group start wxRadioButton *chief = (wxRadioButton*) NULL; @@ -107,16 +103,11 @@ bool wxRadioButton::Create( wxWindow *parent, if (chief) { // we are part of the group started by chief - m_radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) ); - } - else - { - // start a new group - m_radioButtonGroup = (GSList*) NULL; + radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) ); } } - m_widget = gtk_radio_button_new_with_label( m_radioButtonGroup, wxGTK_CONV( label ) ); + m_widget = gtk_radio_button_new_with_label( radioButtonGroup, wxGTK_CONV( label ) ); SetLabel(label); diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index d6440f577a..9d0f498fae 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -83,12 +83,8 @@ bool wxRadioButton::Create( wxWindow *parent, return FALSE; } - if (HasFlag(wxRB_GROUP)) - { - // start a new group - m_radioButtonGroup = (GSList*) NULL; - } - else + GSList* radioButtonGroup = NULL; + if (!HasFlag(wxRB_GROUP)) { // search backward for last group start wxRadioButton *chief = (wxRadioButton*) NULL; @@ -107,16 +103,11 @@ bool wxRadioButton::Create( wxWindow *parent, if (chief) { // we are part of the group started by chief - m_radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) ); - } - else - { - // start a new group - m_radioButtonGroup = (GSList*) NULL; + radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) ); } } - m_widget = gtk_radio_button_new_with_label( m_radioButtonGroup, wxGTK_CONV( label ) ); + m_widget = gtk_radio_button_new_with_label( radioButtonGroup, wxGTK_CONV( label ) ); SetLabel(label);