+ wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
+
+ wxList::compatibility_iterator node = m_boxes.Item( n );
+
+ wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") );
+
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
+
+#ifdef __WXGTK20__
+ wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
+#else
+ wxString str( label->label );
+#endif
+
+ return str;
+}
+
+void wxRadioBox::SetLabel( const wxString& label )
+{
+ wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
+
+ wxControl::SetLabel( label );
+
+ gtk_frame_set_label( GTK_FRAME(m_widget), wxGTK_CONV( wxControl::GetLabel() ) );
+}
+
+void wxRadioBox::SetString( int item, const wxString& label )
+{
+ wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
+
+ wxList::compatibility_iterator node = m_boxes.Item( item );
+
+ wxCHECK_RET( node, wxT("radiobox wrong index") );
+
+ GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
+
+ gtk_label_set( g_label, wxGTK_CONV( label ) );
+}
+
+bool wxRadioBox::Enable( bool enable )
+{
+ if ( !wxControl::Enable( enable ) )
+ return FALSE;
+
+ wxList::compatibility_iterator node = m_boxes.GetFirst();
+ while (node)
+ {
+ GtkButton *button = GTK_BUTTON( node->GetData() );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
+
+ gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
+ gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
+ node = node->GetNext();
+ }
+
+ return TRUE;
+}
+
+void wxRadioBox::Enable( int item, bool enable )
+{
+ wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
+
+ wxList::compatibility_iterator node = m_boxes.Item( item );
+
+ wxCHECK_RET( node, wxT("radiobox wrong index") );
+
+ GtkButton *button = GTK_BUTTON( node->GetData() );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
+
+ gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
+ gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
+}
+
+void wxRadioBox::Show( int item, bool show )
+{
+ wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
+
+ wxList::compatibility_iterator node = m_boxes.Item( item );
+
+ wxCHECK_RET( node, wxT("radiobox wrong index") );
+
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
+
+ if (show)
+ gtk_widget_show( button );
+ else
+ gtk_widget_hide( button );
+}
+
+wxString wxRadioBox::GetStringSelection() const
+{
+ wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
+
+ wxList::compatibility_iterator node = m_boxes.GetFirst();
+ while (node)
+ {
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
+ if (button->active)
+ {
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
+
+#ifdef __WXGTK20__
+ wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
+#else
+ wxString str( label->label );
+#endif
+ return str;
+ }
+ node = node->GetNext();
+ }
+
+ wxFAIL_MSG( wxT("wxRadioBox none selected") );
+ return wxT("");
+}