Ignore:
Timestamp:
11/10/03 11:25:13 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc

    r2484 r2491  
    107107
    108108// ------------ Workaround for a non working TGTextView::Search -------------
     109#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,05)
    109110class MGTextView : public TGTextView
    110111{
     
    165166    }
    166167};
     168#else
     169#define MGTextView TGTextView
     170#endif
    167171// --------------------------------------------------------------------------
    168172
     
    566570
    567571    fFont = gVirtualX->LoadQueryFont("7x13bold");
     572    fMutex = new TMutex;
    568573
    569574    //
     
    666671    if (fFont)
    667672        gVirtualX->DeleteFont(fFont);
     673
     674    //
     675    // Delete mutex
     676    //
     677    delete fMutex;
    668678}
    669679
     
    820830
    821831    // layout and map new tab
    822     Layout();
    823     MapSubwindows();
    824     Layout();
     832    Layout();          // seems to layout the TGCompositeFrame
     833    MapSubwindows();   // maps the TGCompositeFrame
     834    Layout();          // layout the embedded canvas in the frame
    825835
    826836    // display new tab in the main frame
     
    864874    // the main thread.
    865875    //
    866     // NOTE: Maybe there is still need to make sure, that only
    867     //       one thread can update the canvas by calling UpdateTab
    868     //       at the same time. Could be done by a TMutex.
    869     //
    870876    if (gThreadXAR)
    871877    {
     
    881887    }
    882888
    883 #if ROOT_VERSION_CODE < ROOT_VERSION(3,10,01)
     889    //
     890    // Secure calls to update the tabs against itself, at least
     891    // c->Paint() or c->Flush() may crash X (bad drawable).
     892    // This makes sure, that a X call is not interuppted by
     893    // another X-call which was started from an gui interrrupt
     894    // in the same thread
     895    //
     896    if (mutex->TryLock()==13)
     897        return;
     898
     899#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
    884900    TPad *padsav = (TPad*)gPad;
    885901    if (!gPad)
     
    897913    c->Flush();                   // Copy all pad pixmaps to the screen
    898914
    899 #if ROOT_VERSION_CODE < ROOT_VERSION(3,10,01)
     915#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
    900916    if (padsav)
    901917        padsav->cd();
     
    903919        gPad=NULL;
    904920#endif
     921
    905922    //c->SetCursor(kCross);
    906923
     
    909926    //c->Update();
    910927    //c->Paint();
     928
     929    mutex->UnLock();
    911930}
    912931
     
    979998
    980999    fTab->RemoveTab(i);
     1000    fTab->SetTab(0);
     1001
     1002    // Looks strange...
     1003    // const Int_t n = fTab->GetNumberOfTabs();
     1004    // fTab->SetTab(i<=n-1 ? i : i-1);
    9811005
    9821006    // layout and map new tab
    983 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,00)
    984     MapSubwindows();
    985     Layout();
    986 #else
    987     Layout();
    988     MapSubwindows();
    989 #endif
     1007    Layout();          // seems to layout the TGCompositeFrame
     1008    MapSubwindows();   // maps the TGCompositeFrame
     1009    Layout();          // layout the embedded canvas in the frame
    9901010
    9911011    // display new tab in the main frame
     
    18581878
    18591879    ps.Close();
    1860 
    1861     if (num<0)
    1862         *fLog << inf << " - ";
    1863 
    1864     SetStatusLine2("Updating Postscript header...");
    1865     *fLog << inf << "Updating Postscript header..." << flush;
    18661880    UpdatePSHeader(name);
    1867     *fLog << inf << "done." << endl;
    1868 
    18691881
    18701882    gVirtualPS = psave;
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.h

    r2477 r2491  
    2020class TPad;
    2121class TTimer;
     22class TMutex;
    2223class TCanvas;
    2324
     
    6465    TGLayoutHints    *fLayCanvas;
    6566
    66     TTimer fTimer;
     67    TTimer  fTimer;
     68    TMutex *fMutex;
    6769
    6870    TGStatusBar *fStatusBar;
     
    122124
    123125     void StartUpdate(Int_t millisec=-1);
    124      void StopUpdate();                 
    125      void SetUpdateTime(Long_t t);       
     126     void StopUpdate();
     127     void SetUpdateTime(Long_t t);
    126128
    127129     void SetProgressBarPosition(Float_t p);
Note: See TracChangeset for help on using the changeset viewer.