lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 5bb0b55 2/3: Update statusbar smoothly (VZ)


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5bb0b55 2/3: Update statusbar smoothly (VZ)
Date: Tue, 26 Jun 2018 18:36:54 -0400 (EDT)

branch: master
commit 5bb0b550b96b1543bbabf43a0c75d167af4756ad
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Update statusbar smoothly (VZ)
    
    See:
      https://lists.nongnu.org/archive/html/lmi/2018-06/msg00025.html
    | it is indeed possible with wxStatusBar -- wxWindow::Update() should
    | be called instead, to update the window appearance immediately.
    
    On the removal of wxSafeYield(), which caused "choppy" updates to the
    statusbar even with an immediate Update() call, see other messages in
    that thread.
---
 alert_wx.cpp    | 9 +++++++--
 census_view.cpp | 1 -
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/alert_wx.cpp b/alert_wx.cpp
index 681239b..f865745 100644
--- a/alert_wx.cpp
+++ b/alert_wx.cpp
@@ -59,9 +59,14 @@ void status_alert(std::string const& s)
     if(wxTheApp && wxTheApp->GetTopWindow())
         {
         wxFrame* f = dynamic_cast<wxFrame*>(wxTheApp->GetTopWindow());
-        if(f && f->GetStatusBar())
+        if(f)
             {
-            f->SetStatusText(s);
+            wxStatusBar* b = f->GetStatusBar();
+            if(b)
+                {
+                f->SetStatusText(s);
+                f->GetStatusBar()->Update();
+                }
             }
         }
 }
diff --git a/census_view.cpp b/census_view.cpp
index dce6666..3bcf28c 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1825,7 +1825,6 @@ void CensusView::UponPasteCensus(wxCommandEvent&)
         cells.push_back(current_cell);
 
         status() << "Added cell number " << cells.size() << '.' << std::flush;
-        wxSafeYield();
         }
 
     if(0 == current_line)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]