From 58b907f6e1ba4a25a99ce65e044fbd4285905aaf Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 5 Feb 2005 12:51:05 +0000 Subject: [PATCH] _conncect_after() should be used for controls emitting command events so as to not confuse GTK+ if the user intercepts them too early. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/bmpbuttn.cpp | 2 +- src/gtk/button.cpp | 2 +- src/gtk/choice.cpp | 2 +- src/gtk/combobox.cpp | 10 +++++----- src/gtk1/bmpbuttn.cpp | 2 +- src/gtk1/button.cpp | 2 +- src/gtk1/choice.cpp | 2 +- src/gtk1/combobox.cpp | 10 +++++----- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index b209fabcc5..ed67afffaf 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -149,7 +149,7 @@ bool wxBitmapButton::Create( wxWindow *parent, OnSetBitmap(); } - gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", + gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_bmpbutton_clicked_callback), (gpointer*)this ); gtk_signal_connect( GTK_OBJECT(m_widget), "enter", diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 5d6dda1190..640ba4139c 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -145,7 +145,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, if (style & wxNO_BORDER) gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); - gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", + gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this ); m_parent->DoAddChild( this ); diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index a2fa3409c8..59d5402c12 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -569,7 +569,7 @@ int wxChoice::GtkAddHelper(GtkWidget *menu, int pos, const wxString& item) // it has to change. Adapted from Matt Ownby. InvalidateBestSize(); - gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", + gtk_signal_connect_after( GTK_OBJECT( menu_item ), "activate", GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); gtk_widget_show( menu_item ); diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 6c40b2d84a..e5dd27f1ea 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -122,7 +122,7 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi gtk_signal_disconnect_by_func( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)combo ); combo->SetValue( combo->GetStringSelection() ); - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)combo ); // throw a SELECTED event only if the combobox popup is hidden @@ -264,10 +264,10 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, gtk_signal_connect( GTK_OBJECT(GTK_COMBO(combo)->popwin), "show", GTK_SIGNAL_FUNC(gtk_popup_show_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(combo->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(combo->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(combo->list), "select-child", + gtk_signal_connect_after( GTK_OBJECT(combo->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); SetBestSize(size); // need this too because this is a wxControlWithItems @@ -879,9 +879,9 @@ void wxComboBox::DisableEvents() void wxComboBox::EnableEvents() { - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->list), "select-child", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(m_widget)->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this ); } diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index b209fabcc5..ed67afffaf 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -149,7 +149,7 @@ bool wxBitmapButton::Create( wxWindow *parent, OnSetBitmap(); } - gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", + gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_bmpbutton_clicked_callback), (gpointer*)this ); gtk_signal_connect( GTK_OBJECT(m_widget), "enter", diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 5d6dda1190..640ba4139c 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -145,7 +145,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, if (style & wxNO_BORDER) gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); - gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", + gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this ); m_parent->DoAddChild( this ); diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index a2fa3409c8..59d5402c12 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -569,7 +569,7 @@ int wxChoice::GtkAddHelper(GtkWidget *menu, int pos, const wxString& item) // it has to change. Adapted from Matt Ownby. InvalidateBestSize(); - gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", + gtk_signal_connect_after( GTK_OBJECT( menu_item ), "activate", GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); gtk_widget_show( menu_item ); diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 6c40b2d84a..e5dd27f1ea 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -122,7 +122,7 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi gtk_signal_disconnect_by_func( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)combo ); combo->SetValue( combo->GetStringSelection() ); - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(combo->GetHandle())->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)combo ); // throw a SELECTED event only if the combobox popup is hidden @@ -264,10 +264,10 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, gtk_signal_connect( GTK_OBJECT(GTK_COMBO(combo)->popwin), "show", GTK_SIGNAL_FUNC(gtk_popup_show_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(combo->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(combo->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(combo->list), "select-child", + gtk_signal_connect_after( GTK_OBJECT(combo->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); SetBestSize(size); // need this too because this is a wxControlWithItems @@ -879,9 +879,9 @@ void wxComboBox::DisableEvents() void wxComboBox::EnableEvents() { - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->list), "select-child", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(m_widget)->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed", + gtk_signal_connect_after( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed", GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this ); } -- 2.45.2