Changeset 11412 for trunk/Mars


Ignore:
Timestamp:
07/14/11 18:43:21 (13 years ago)
Author:
tbretz
Message:
Fixed a problem with a possible infinite loop in the display.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mbase/MStatusDisplay.cc

    r11407 r11412  
    12011201        return;
    12021202
     1203    //
     1204    // If we are in a multithreaded environment (gThreadXAR) we
     1205    // have to make sure, that thus function is called from
     1206    // the main thread.
     1207    //
     1208    if (gThreadXAR)
     1209    {
     1210        // Tell the X-Requester how to call this method
     1211        const TString str = MString::Format("%ld", (ULong_t)f);
     1212
     1213        TMethodCall call(IsA(), "UpdateTab", "NULL");
     1214        void *arr[4] = { NULL, &call, this, (void*)(const char*)str };
     1215
     1216        // If this is not the main thread return
     1217        if (((*gThreadXAR)("METH", 4, arr, NULL)))
     1218            return;
     1219    }
     1220
    12031221    TCanvas *c=GetCanvas(*f);
    12041222    if (!c)
     
    12081226    const TString title = c->GetTitle();
    12091227
    1210     if (!title.IsNull() && name != title)
    1211         SetStatusLine1(title);
    1212 
    1213     //
    1214     // If we are in a multithreaded environment (gThreadXAR) we
    1215     // have to make sure, that thus function is called from
    1216     // the main thread.
    1217     //
    1218     if (gThreadXAR)
    1219     {
    1220         // Tell the X-Requester how to call this method
    1221         TString str = MString::Format("%d", (ULong_t)f);
    1222 
    1223         TMethodCall call(IsA(), "UpdateTab", "NULL");
    1224         void *arr[4] = { NULL, &call, this, (void*)(const char*)str };
    1225 
    1226         // If this is not the main thread return
    1227         if (((*gThreadXAR)("METH", 4, arr, NULL)))
    1228             return;
    1229     }
     1228    if (!gROOT->IsBatch())
     1229        fStatusBar->SetText(title, 0);
     1230
     1231    // It seems that we cannot use this because an update
     1232    // initiated by a gui event can interfere with the regular
     1233    // update from the timer and then ProcessEvents will
     1234    // end in an infinite loop.
     1235    // SetStatusLine1(title);
     1236
    12301237
    12311238    //
Note: See TracChangeset for help on using the changeset viewer.