X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68567a967bc8afd37a40cb9a7ee5021b9ee6cd96..1dabdced0ebd3fb19419b5a4737e2e30d0c8bd12:/src/gtk/radiobox.cpp?ds=sidebyside diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 80ec423554..0e06bba68b 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -86,7 +86,7 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_ return FALSE; } - gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" ); + g_signal_stop_emission_by_name (widget, "key_press_event"); if ((gdk_event->keyval == GDK_Up) || (gdk_event->keyval == GDK_Left)) @@ -222,7 +222,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, for (int i = 0; i < n; i++) { if ( i != 0 ) - radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); + radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(m_radio) ); label.Empty(); for ( const wxChar *pc = choices[i]; *pc; pc++ ) @@ -234,8 +234,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, wxGTK_CONV( label ) ) ); gtk_widget_show( GTK_WIDGET(m_radio) ); - gtk_signal_connect( GTK_OBJECT(m_radio), "key_press_event", - GTK_SIGNAL_FUNC(gtk_radiobox_keypress_callback), (gpointer)this ); + g_signal_connect (m_radio, "key_press_event", + G_CALLBACK (gtk_radiobox_keypress_callback), this); m_boxes.Append( (wxObject*) m_radio ); @@ -260,16 +260,15 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, ConnectWidget( GTK_WIDGET(m_radio) ); - if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); + if (!i) + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_radio), TRUE ); - gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); - - gtk_signal_connect( GTK_OBJECT(m_radio), "focus_in_event", - GTK_SIGNAL_FUNC(gtk_radiobutton_focus_in), (gpointer)this ); - - gtk_signal_connect( GTK_OBJECT(m_radio), "focus_out_event", - GTK_SIGNAL_FUNC(gtk_radiobutton_focus_out), (gpointer)this ); + g_signal_connect (m_radio, "clicked", + G_CALLBACK (gtk_radiobutton_clicked_callback), this); + g_signal_connect (m_radio, "focus_in_event", + G_CALLBACK (gtk_radiobutton_focus_in), this); + g_signal_connect (m_radio, "focus_out_event", + G_CALLBACK (gtk_radiobutton_focus_out), this); } m_parent->DoAddChild( this ); @@ -383,7 +382,7 @@ wxString wxRadioBox::GetString( int n ) const wxCHECK_MSG( node, wxEmptyString, wxT("radiobox wrong index") ); - GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) ); + GtkLabel *label = GTK_LABEL(GTK_BIN(node->GetData())->child); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); @@ -405,9 +404,9 @@ void wxRadioBox::SetString( int item, const wxString& label ) wxCHECK_RET( node, wxT("radiobox wrong index") ); - GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->GetData()) ); + GtkLabel *g_label = GTK_LABEL(GTK_BIN(node->GetData())->child); - gtk_label_set( g_label, wxGTK_CONV( label ) ); + gtk_label_set_text( g_label, wxGTK_CONV( label ) ); } bool wxRadioBox::Enable( bool enable ) @@ -419,7 +418,7 @@ bool wxRadioBox::Enable( bool enable ) while (node) { GtkButton *button = GTK_BUTTON( node->GetData() ); - GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); + GtkLabel *label = GTK_LABEL(GTK_BIN(button)->child); gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(label), enable ); @@ -438,7 +437,7 @@ bool wxRadioBox::Enable( int item, bool enable ) wxCHECK_MSG( node, false, wxT("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->GetData() ); - GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); + GtkLabel *label = GTK_LABEL(GTK_BIN(button)->child); gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(label), enable ); @@ -502,8 +501,9 @@ void wxRadioBox::GtkDisableEvents() wxList::compatibility_iterator node = m_boxes.GetFirst(); while (node) { - gtk_signal_disconnect_by_func( GTK_OBJECT(node->GetData()), - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + g_signal_handlers_disconnect_by_func (node->GetData(), + (gpointer) gtk_radiobutton_clicked_callback, + this); node = node->GetNext(); } @@ -514,8 +514,8 @@ void wxRadioBox::GtkEnableEvents() wxList::compatibility_iterator node = m_boxes.GetFirst(); while (node) { - gtk_signal_connect( GTK_OBJECT(node->GetData()), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + g_signal_connect (node->GetData(), "clicked", + G_CALLBACK (gtk_radiobutton_clicked_callback), this); node = node->GetNext(); } @@ -532,7 +532,7 @@ void wxRadioBox::DoApplyWidgetStyle(GtkRcStyle *style) GtkWidget *widget = GTK_WIDGET( node->GetData() ); gtk_widget_modify_style( widget, style ); - gtk_widget_modify_style( BUTTON_CHILD(node->GetData()), style ); + gtk_widget_modify_style(GTK_BIN(widget)->child, style); node = node->GetNext(); }