X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937013e0fd914d4c42f9f5ec98da665986b93dfa..6cf68971005ab7a0ccee82ffffa2924eeb62f689:/src/gtk/spinbutt.cpp diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index b886fbc324..4ed8250624 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -107,6 +107,7 @@ bool wxSpinButton::Create(wxWindow *parent, m_pos = 0; m_widget = gtk_spin_button_new_with_range(0, 100, 1); + g_object_ref(m_widget); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (int)(m_windowStyle & wxSP_WRAP) ); @@ -174,6 +175,20 @@ void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) ) gtk_widget_set_size_request( m_widget, m_width, m_height ); } +bool wxSpinButton::Enable( bool enable ) +{ + bool isEnabled = IsEnabled(); + + if ( !wxControl::Enable( enable ) ) + return false; + + // Work around lack of visual update when enabling + if (!isEnabled && enable) + GTKFixSensitivity(false /* fix even if not under mouse */); + + return true; +} + void wxSpinButton::GtkDisableEvents() const { g_signal_handlers_block_by_func(m_widget,