// Quickly set the value of the combo box
// as GTK+ does that only AFTER the event
// is sent.
- g_signal_handlers_disconnect_by_func (GTK_COMBO (combo->GetHandle())->entry,
- (gpointer) gtkcombo_text_changed_callback,
- combo);
+ GtkWidget* entry = GTK_COMBO(combo->GetHandle())->entry;
+ g_signal_handlers_block_by_func(
+ entry, (gpointer)gtkcombo_text_changed_callback, combo);
combo->SetValue( combo->GetStringSelection() );
- g_signal_connect_after (GTK_COMBO (combo->GetHandle())->entry, "changed",
- G_CALLBACK (gtkcombo_text_changed_callback), combo);
+ g_signal_handlers_unblock_by_func(
+ entry, (gpointer)gtkcombo_text_changed_callback, combo);
// throw a SELECTED event only if the combobox popup is hidden (wxID_NONE)
// because when combobox popup is shown, gtkcombo_combo_select_child_callback is
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
- g_signal_handlers_disconnect_by_func (GTK_BIN(m_widget)->child,
- (gpointer)gtkcombobox_text_changed_callback, this);
+ g_signal_handlers_block_by_func(GTK_BIN(m_widget)->child,
+ (gpointer)gtkcombobox_text_changed_callback, this);
- g_signal_handlers_disconnect_by_func (m_widget,
- (gpointer)gtkcombobox_changed_callback, this);
+ g_signal_handlers_block_by_func(m_widget,
+ (gpointer)gtkcombobox_changed_callback, this);
}
else
#endif
{
- g_signal_handlers_disconnect_by_func (GTK_COMBO(m_widget)->list,
- (gpointer) gtkcombo_combo_select_child_callback, this);
+ g_signal_handlers_block_by_func(GTK_COMBO(m_widget)->list,
+ (gpointer) gtkcombo_combo_select_child_callback, this);
- g_signal_handlers_disconnect_by_func (GTK_COMBO(m_widget)->entry,
- (gpointer) gtkcombo_text_changed_callback, this);
+ g_signal_handlers_block_by_func(GTK_COMBO(m_widget)->entry,
+ (gpointer) gtkcombo_text_changed_callback, this);
}
}
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
- g_signal_connect_after (GTK_BIN(m_widget)->child, "changed",
- G_CALLBACK (gtkcombobox_text_changed_callback), this);
+ g_signal_handlers_unblock_by_func(GTK_BIN(m_widget)->child,
+ (gpointer)gtkcombobox_text_changed_callback, this);
- g_signal_connect_after (m_widget, "changed",
- G_CALLBACK (gtkcombobox_changed_callback), this);
+ g_signal_handlers_unblock_by_func(m_widget,
+ (gpointer)gtkcombobox_changed_callback, this);
}
else
#endif
{
- g_signal_connect_after (GTK_COMBO(m_widget)->list, "select-child",
- G_CALLBACK (gtkcombo_combo_select_child_callback),
- this);
- g_signal_connect_after (GTK_COMBO(m_widget)->entry, "changed",
- G_CALLBACK (gtkcombo_text_changed_callback),
- this );
+ g_signal_handlers_unblock_by_func(GTK_COMBO(m_widget)->list,
+ (gpointer) gtkcombo_combo_select_child_callback, this);
+
+ g_signal_handlers_unblock_by_func(GTK_COMBO(m_widget)->entry,
+ (gpointer) gtkcombo_text_changed_callback, this);
}
}
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);
wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
while (node)
{
- g_signal_handlers_disconnect_by_func (node->GetData()->button,
- (gpointer) gtk_radiobutton_clicked_callback,
- this);
+ g_signal_handlers_block_by_func(node->GetData()->button,
+ (gpointer)gtk_radiobutton_clicked_callback, this);
node = node->GetNext();
}
wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
while (node)
{
- g_signal_connect (node->GetData()->button, "clicked",
- G_CALLBACK (gtk_radiobutton_clicked_callback), this);
+ g_signal_handlers_unblock_by_func(node->GetData()->button,
+ (gpointer)gtk_radiobutton_clicked_callback, this);
node = node->GetNext();
}
m_scrollPos[i] =
adj->value = viewStart;
- g_signal_handlers_disconnect_by_func( m_widget,
- (gpointer)gtk_value_changed, this);
+ g_signal_handlers_block_by_func(m_widget,
+ (gpointer)gtk_value_changed, this);
gtk_adjustment_value_changed(adj);
-
- g_signal_connect_after(m_widget, "value_changed",
- G_CALLBACK(gtk_value_changed), this);
+
+ g_signal_handlers_unblock_by_func(m_widget,
+ (gpointer)gtk_value_changed, this);
}
}
return;
}
+ void* blockWidget = IsMultiLine() ? (void*)m_buffer : (void*)m_text;
+ g_signal_handlers_block_by_func(blockWidget,
+ (gpointer)gtk_text_changed_callback, this);
if ( IsMultiLine() )
{
- g_signal_handlers_disconnect_by_func (m_buffer,
- (gpointer) gtk_text_changed_callback, this);
-
gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
if ( !m_defaultStyle.IsDefault() )
wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle,
&start, &end);
}
-
- g_signal_connect (m_buffer, "changed",
- G_CALLBACK (gtk_text_changed_callback), this);
}
else
{
- g_signal_handlers_disconnect_by_func (m_text,
- (gpointer) gtk_text_changed_callback, this);
-
gtk_entry_set_text( GTK_ENTRY(m_text), buffer );
-
- g_signal_connect (m_text, "changed",
- G_CALLBACK (gtk_text_changed_callback), this);
}
+ g_signal_handlers_unblock_by_func(blockWidget,
+ (gpointer)gtk_text_changed_callback, this);
// This was added after discussion on the list
SetInsertionPoint(0);
pos = 0;
m_scrollPos[dir] = adj->value = pos;
- g_signal_handlers_disconnect_by_func( m_scrollBar[dir],
- (gpointer)gtk_scrollbar_value_changed, this);
+ g_signal_handlers_block_by_func(m_scrollBar[dir],
+ (gpointer)gtk_scrollbar_value_changed, this);
gtk_adjustment_value_changed(adj);
-
- g_signal_connect_after(m_scrollBar[dir], "value_changed",
- G_CALLBACK(gtk_scrollbar_value_changed), this);
+
+ g_signal_handlers_unblock_by_func(m_scrollBar[dir],
+ (gpointer)gtk_scrollbar_value_changed, this);
}
}