+ GtkDisableEvents();
+ gtk_spin_button_set_range( GTK_SPIN_BUTTON(m_widget), minVal, maxVal);
+ GtkEnableEvents();
+}
+
+void wxSpinCtrlGTKBase::DoSetIncrement(double inc)
+{
+ wxCHECK_RET( m_widget, "invalid spin button" );
+
+ GtkDisableEvents();
+
+ // Preserve the old page value when changing just the increment.
+ double page = 10*inc;
+ gtk_spin_button_get_increments( GTK_SPIN_BUTTON(m_widget), NULL, &page);
+
+ gtk_spin_button_set_increments( GTK_SPIN_BUTTON(m_widget), inc, page);
+ GtkEnableEvents();
+}
+
+void wxSpinCtrlGTKBase::GtkDisableEvents() const
+{
+ g_signal_handlers_block_by_func( m_widget,
+ (gpointer)gtk_value_changed, (void*) this);
+
+ g_signal_handlers_block_by_func(m_widget,
+ (gpointer)gtk_changed, (void*) this);
+}
+
+void wxSpinCtrlGTKBase::GtkEnableEvents() const
+{
+ g_signal_handlers_unblock_by_func(m_widget,
+ (gpointer)gtk_value_changed, (void*) this);
+
+ g_signal_handlers_unblock_by_func(m_widget,
+ (gpointer)gtk_changed, (void*) this);