X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de97a3b945c99fb942209df48be26f43c1b436d..4c444f19cf1bdb3cb26bb3c123434fe23c808093:/src/gtk/radiobox.cpp diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 6195828b7a..e1e66d05c6 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -166,14 +166,16 @@ int wxRadioBox::GetSelection(void) const { GSList *item = gtk_radio_button_group( m_radio ); int count = 0; + int found = -1; while (item) { GtkButton *button = GTK_BUTTON( item->data ); - if (GTK_TOGGLE_BUTTON(button)->active) return count; + if (GTK_TOGGLE_BUTTON(button)->active) found = count; count++; item = item->next; } - return -1; + + return found != -1 ? count-found-1 : -1; } wxString wxRadioBox::GetString( int n ) const