X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/823fb291ae04c8236e4ef129209f488812d638fb..8ca1a013e4e699724040ff1f514dab3b4a11d3c9:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index be9cc04945..c878f8728f 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -294,26 +294,22 @@ int wxNotebook::DoSetSelection( size_t page, int flags ) if ( !(flags & SetSelection_SendEvent) ) { - g_signal_handlers_disconnect_by_func (m_widget, - (gpointer) gtk_notebook_page_changing_callback, - this); + g_signal_handlers_block_by_func(m_widget, + (gpointer)gtk_notebook_page_changing_callback, this); - g_signal_handlers_disconnect_by_func (m_widget, - (gpointer) gtk_notebook_page_changed_callback, - this); + g_signal_handlers_block_by_func(m_widget, + (gpointer)gtk_notebook_page_changed_callback, this); } gtk_notebook_set_current_page( GTK_NOTEBOOK(m_widget), page ); if ( !(flags & SetSelection_SendEvent) ) { - // reconnect to signals + g_signal_handlers_unblock_by_func(m_widget, + (gpointer)gtk_notebook_page_changing_callback, this); - g_signal_connect (m_widget, "switch_page", - G_CALLBACK (gtk_notebook_page_changing_callback), this); - - g_signal_connect_after (m_widget, "switch_page", - G_CALLBACK (gtk_notebook_page_changed_callback), this); + g_signal_handlers_unblock_by_func(m_widget, + (gpointer)gtk_notebook_page_changed_callback, this); } wxNotebookPage *client = GetPage(page);