]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed horrible flicker and 100 CPU usage (text ctrl was being updated all the time)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Oct 2003 00:19:35 +0000 (00:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Oct 2003 00:19:35 +0000 (00:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/widgets/textctrl.cpp

index bf45656175aaa49d95dbb66f443ba6b010ac4284..e744691027874e367b45af02c80764541315e74b 100644 (file)
@@ -200,6 +200,8 @@ protected:
          m_selFrom,
          m_selTo;
 
+    wxString m_range10_20;
+
 private:
     // any class wishing to process wxWindows events must use this macro
     DECLARE_EVENT_TABLE()
@@ -632,7 +634,12 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event))
 
     if ( m_textRange )
     {
-        m_textRange->SetValue(m_text->GetRange(10, 20));
+        wxString range = m_text->GetRange(10, 20);
+        if ( range != m_range10_20 )
+        {
+            m_range10_20 = range;
+            m_textRange->SetValue(range);
+        }
     }
 }