[ROOT] Problem displaying text in TGStatusBar

From: cstrato (aon.912121399@aon.at)
Date: Sun Jun 15 2003 - 18:41:54 MEST


Dear Rooters

In a while-loop I am importing data and want to display
the data names in the statusbar of my GUI-app.
Sorrowly, only the last message is displayed when the
while-loop finishes.

Do you know what  I have to do so that the text is
displayed in the statusbar whenever I call:
fStatusBar->SetText(text,0)?

My code looks like this:

class AppFrame {
   RQ_OBJECT("AppFrame")

   private:
      TGMainFrame        *fMain;
      TGStatusBar        *fStatusBar;

   public:
      AppFrame() {}
      AppFrame(const TGWindow *window, UInt_t w, UInt_t h);
      virtual AppFrame();

      void SetStatusBarText(const char *text, Int_t partidx)
                        {fStatusBar->SetText(text, partidx);}

      ClassDef(AppFrame,0)
};

class DataFrame {
   RQ_OBJECT("DataFrame")

   private:
      AppFrame           *fAppFrame;
      TGCompositeFrame   *fParentFrame;

   public:
      DataFrame() {}
      DataFrame(TGCompositeFrame *parent, AppFrame *main, UInt_t w, 
UInt_t h);
      virtual ~DataFrame();

      void DoImportData();

      ClassDef(DataFrame,0)
};

void DataFrame::DoImportData()
{
   char    buf[256];
// Import data
   TIter next(mylist);
   MyData *data = 0;
   while ((data = (MyData*)next())) {
      TString name = data->GetName();

      // display current status
      gSystem->Sleep(4000);//test only
      gSystem->ProcessEvents();  // handle GUI events??
      sprintf(buf, "Importing file <%s>...", name.Data());
      fAppFrame->SetStatusBarText(buf, 0);

      class->Import(name.Data());
   }//while

// Close file
   TString datafile = class->GetFile()->GetName();
   sprintf(buf, "Data import finished, closing file <%s>...", 
datafile.Data());
   fAppFrame->SetStatusBarText(buf, 0);
   class->Close();
   fAppFrame->SetStatusBarText("Ready...", 0);
}//DoImportData

Thank you in advance
Best regards
Christian
_._._._._._._._._._._._._._._._
C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
V.i.e.n.n.a       A.u.s.t.r.i.a
_._._._._._._._._._._._._._._._



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET