commit 3805a551fbfc738cc2f51e3b5c054653e03f0222
parent 38cc7f2343a14150e7554b98581579b94f12ffc7
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Wed, 15 Aug 2012 10:24:22 -0700
Force re-paint
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc
@@ -25,6 +25,7 @@
#include "spek-spectrogram.hh"
BEGIN_EVENT_TABLE(SpekSpectrogram, wxPanel)
+ EVT_IDLE(SpekSpectrogram::on_idle)
EVT_PAINT(SpekSpectrogram::on_paint)
EVT_SIZE(SpekSpectrogram::on_size)
END_EVENT_TABLE()
@@ -73,6 +74,11 @@ void SpekSpectrogram::save(const wxString& path)
{
}
+void SpekSpectrogram::on_idle(wxIdleEvent& evt)
+{
+ Update();
+}
+
void SpekSpectrogram::on_paint(wxPaintEvent& evt)
{
wxAutoBufferedPaintDC dc(this);
@@ -176,6 +182,7 @@ void SpekSpectrogram::pipeline_cb(int sample, float *values, void *cb_data)
}
s->Refresh(); // TODO: refresh only one pixel column
+ wxWakeUpIdle();
}
diff --git a/src/spek-spectrogram.hh b/src/spek-spectrogram.hh
@@ -31,6 +31,7 @@ public:
void save(const wxString& path);
private:
+ void on_idle(wxIdleEvent& evt);
void on_paint(wxPaintEvent& evt);
void on_size(wxSizeEvent& evt);
void render(wxDC& dc);