X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3e717ecc5add075cd53a04cf24fe27e24170944..48a84964c6400fddc79651ef6d74d7a979207ef1:/src/gtk1/radiobox.cpp diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 3e2dc3124c..1871c04a4a 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -166,7 +166,7 @@ wxSize wxRadioBox::LayoutItems() if ( m_majorDim == 0 ) { // avoid dividing by 0 below - wxFAIL_MSG( "dimension of radiobox should not be 0!" ); + wxFAIL_MSG( _T("dimension of radiobox should not be 0!") ); m_majorDim = 1; } @@ -328,7 +328,11 @@ void wxRadioBox::SetSelection( int n ) GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); + DisableEvents(); + gtk_toggle_button_set_state( button, 1 ); + + EnableEvents(); } int wxRadioBox::GetSelection(void) const @@ -494,6 +498,30 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } +void wxRadioBox::DisableEvents() +{ + wxNode *node = m_boxes.First(); + while (node) + { + gtk_signal_disconnect_by_func( GTK_OBJECT(node->Data()), + GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + + node = node->Next(); + } +} + +void wxRadioBox::EnableEvents() +{ + wxNode *node = m_boxes.First(); + while (node) + { + gtk_signal_connect( GTK_OBJECT(node->Data()), "clicked", + GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + + node = node->Next(); + } +} + void wxRadioBox::ApplyWidgetStyle() { SetWidgetStyle();