gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
(int)(m_windowStyle & wxSP_WRAP) );
- gtk_signal_connect( GTK_OBJECT (m_adjust),
- "value_changed",
- (GtkSignalFunc) gtk_spinctrl_callback,
- (gpointer) this );
-
+ GtkEnableEvents();
m_parent->DoAddChild( this );
PostCreation();
return TRUE;
}
+void wxSpinCtrl::GtkDisableEvents()
+{
+ gtk_signal_disconnect_by_func( GTK_OBJECT(m_adjust),
+ GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
+ (gpointer) this );
+
+}
+
+void wxSpinCtrl::GtkEnableEvents()
+{
+ gtk_signal_connect( GTK_OBJECT (m_adjust),
+ "value_changed",
+ GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
+ (gpointer) this );
+}
+
int wxSpinCtrl::GetMin() const
{
wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") );
else
{
// invalid number - set text as is (wxMSW compatible)
+ GtkDisableEvents();
gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() );
+ GtkEnableEvents();
}
}
m_adjust->value = fpos;
+ GtkDisableEvents();
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
+ GtkEnableEvents();
}
void wxSpinCtrl::SetRange(int minVal, int maxVal)