GTK4: what's a proper way to change a value of some widget not triggering callback?

Hi everyone,

how to properly change SpinButton’s value not triggering callback execution?

Trying to do this with g_signal_handlers_block_by_func (in the first example) doesn’t help. Suppose it’s because gtk_spin_button_set_value works like async call.

g_signal_connect(spin_button, "value-changed", G_CALLBACK(min_cb), en);

static void min_cb(GtkWidget *spin_button, t_ent_spn *en) {
  g_signal_handlers_block_by_func(spin_button, min_cb, en);
  gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), en);
  g_signal_handlers_unblock_by_func(spin_button, min_cb, en);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.