Ignore:
Timestamp:
04/20/03 12:51:47 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc

    r1836 r1966  
    216216    fList->Add(laycanvas);
    217217
    218     TGCompositeFrame *frame = fEvtDisplay->AddTab(name);
    219     TRootEmbeddedCanvas *canvas = new TRootEmbeddedCanvas(name+"Display", frame, 400, 400);
    220     frame->AddFrame(canvas, laycanvas);
    221     fList->Add(canvas);
    222     return canvas->GetCanvas();
     218    // Add new tab
     219    TGCompositeFrame *f = fEvtDisplay->AddTab(name);
     220
     221    // create root embedded canvas and add it to the tab
     222    TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas(name+"Display", f, f->GetWidth(), f->GetHeight());
     223    f->AddFrame(ec, laycanvas);
     224    fList->Add(ec);
     225
     226    // set background and border mode of the canvas
     227    TCanvas &c = *ec->GetCanvas();
     228    c.SetBorderMode(0);
     229
     230    // layout and map new tab
     231#if ROOT_VERSION_CODE < ROOT_VERSION(3,03,00)
     232    MapSubwindows();
     233    Layout();
     234#else
     235    Layout();
     236    MapSubwindows();
     237#endif
     238
     239    // display new tab in the main frame
     240    gClient->ProcessEventsFor(fEvtDisplay);
     241
     242    // return pointer to new canvas
     243    return &c;
    223244}
    224245
Note: See TracChangeset for help on using the changeset viewer.