Browse Source

Fixed order of notifyStateChanged post example

Ivo Wolf 14 years ago
parent
commit
a4f662cf5e
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

+ 6 - 2
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -96,9 +96,13 @@ void ctkExampleDicomAppLogic::do_something()
 void ctkExampleDicomAppLogic::onStartProgress()
 {
   setInternalState(ctkDicomAppHosting::INPROGRESS);
-  getHostInterface()->notifyStateChanged(ctkDicomAppHosting::INPROGRESS);
 
-  do_something();
+  // we need to create the button before we receive data from
+  // the host, which happens immediately after calling
+  // getHostInterface()->notifyStateChanged
+  do_something(); 
+
+  getHostInterface()->notifyStateChanged(ctkDicomAppHosting::INPROGRESS);
 }
 
 //----------------------------------------------------------------------------