]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/preferences_widgets.cpp/h: work around a wxSpinCtrl recursion...
authorGildas Bazin <gbazin@videolan.org>
Sun, 31 Oct 2004 13:19:28 +0000 (13:19 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 31 Oct 2004 13:19:28 +0000 (13:19 +0000)
modules/gui/wxwindows/preferences_widgets.cpp
modules/gui/wxwindows/preferences_widgets.h

index 243cbb62c9967fa396e5be7714b95006c52e438a..acd6293ede742fedb2ac44952ab225d8914c9aa2 100644 (file)
@@ -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 );
 }
 
 /*****************************************************************************
index f51ab841bf94873709bc9f3a140a3a426b1796d6..51669c61e794a3d3e3e27e572a29ddc60d61db58 100644 (file)
@@ -133,6 +133,9 @@ public:
     virtual int GetIntValue();
 private:
     wxSpinCtrl *spin;
+    int i_value;
+
+    void OnUpdate( wxCommandEvent& );
 
     DECLARE_EVENT_TABLE()
 };