Merge master.
[dcpomatic.git] / src / wx / wx_util.cc
index 367d1edbbf522d12634dbc2c967bea73732f83cd..048f87908e8c72770e973f0450a36767c1b747f3 100644 (file)
@@ -123,7 +123,7 @@ int const ThreadedStaticText::_update_event_id = 10000;
  *  @param initial Initial text for the wxStaticText while the computation is being run.
  *  @param fn Function which works out what the wxStaticText content should be and returns it.
  */
-ThreadedStaticText::ThreadedStaticText (wxWindow* parent, wxString initial, function<string ()> fn)
+ThreadedStaticText::ThreadedStaticText (wxWindow* parent, wxString initial, boost::function<string ()> fn)
        : wxStaticText (parent, wxID_ANY, initial)
 {
        Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ThreadedStaticText::thread_finished, this, _1), _update_event_id);
@@ -139,7 +139,7 @@ ThreadedStaticText::~ThreadedStaticText ()
 
 /** Run our thread and post the result to the GUI thread via AddPendingEvent */
 void
-ThreadedStaticText::run (function<string ()> fn)
+ThreadedStaticText::run (boost::function<string ()> fn)
 try
 {
        wxCommandEvent ev (wxEVT_COMMAND_TEXT_UPDATED, _update_event_id);
@@ -296,3 +296,11 @@ wx_get (wxChoice* w)
 {
        return w->GetSelection ();
 }
+
+void
+run_gui_loop ()
+{
+       while (wxTheApp->Pending ()) {
+               wxTheApp->Dispatch ();
+       }
+}