From ded94d785b5a8b836ebc1e5a31051769313de9d2 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Sun, 31 Oct 2004 13:19:28 +0000 Subject: [PATCH] * modules/gui/wxwindows/preferences_widgets.cpp/h: work around a wxSpinCtrl recursion bug in wxGTK. --- modules/gui/wxwindows/preferences_widgets.cpp | 11 ++++++++++- modules/gui/wxwindows/preferences_widgets.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/gui/wxwindows/preferences_widgets.cpp b/modules/gui/wxwindows/preferences_widgets.cpp index 243cbb62c9..acd6293ede 100644 --- a/modules/gui/wxwindows/preferences_widgets.cpp +++ b/modules/gui/wxwindows/preferences_widgets.cpp @@ -533,6 +533,7 @@ IntegerConfigControl::IntegerConfigControl( vlc_object_t *p_this, sizer->Add( spin, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); sizer->Layout(); this->SetSizerAndFit( sizer ); + i_value = p_item->i_value; } IntegerConfigControl::~IntegerConfigControl() @@ -542,7 +543,15 @@ IntegerConfigControl::~IntegerConfigControl() int IntegerConfigControl::GetIntValue() { - return spin->GetValue(); + /* We avoid using GetValue because of a recursion bug with wxSpinCtrl with + * wxGTK. */ + return i_value; //spin->GetValue(); +} + +void IntegerConfigControl::OnUpdate( wxCommandEvent &event ) +{ + i_value = event.GetInt(); + ConfigControl::OnUpdate( event ); } /***************************************************************************** diff --git a/modules/gui/wxwindows/preferences_widgets.h b/modules/gui/wxwindows/preferences_widgets.h index f51ab841bf..51669c61e7 100644 --- a/modules/gui/wxwindows/preferences_widgets.h +++ b/modules/gui/wxwindows/preferences_widgets.h @@ -133,6 +133,9 @@ public: virtual int GetIntValue(); private: wxSpinCtrl *spin; + int i_value; + + void OnUpdate( wxCommandEvent& ); DECLARE_EVENT_TABLE() }; -- 2.39.5