From 626117f77839a764581e72d3417b2a9489f03020 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 4 Oct 2003 00:19:35 +0000 Subject: [PATCH] fixed horrible flicker and 100 CPU usage (text ctrl was being updated all the time) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/widgets/textctrl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index bf45656175..e744691027 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -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); + } } } -- 2.45.2