Ignore:
Timestamp:
12/11/01 15:22:10 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1082 r1108  
    2626#include "MMars.h"
    2727
     28#include <iostream.h>
     29
    2830#include <TApplication.h>  // gROOT->GetApplication()->...
    2931
     
    3537#include <TG3DLine.h>      // TGHorizontal3DLine
    3638
     39#include "MGList.h"
    3740#include "MEvtDisp.h"
    3841#include "MAnalysis.h"
     
    8588void MMars::CreateTopFrame(TGHorizontalFrame *top)
    8689{
    87     fPic1 = gClient->GetPicture("magiclogo.xpm");
    88     fPic2 = gClient->GetPicture("marslogo.xpm");
    89 
    90     TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic);
    91     TGPictureButton *mars  = new TGPictureButton(top, fPic2, kPicMars);
    92 
    93     fList->Add(magic);
    94     fList->Add(mars);
    95 
    96     magic->Associate(this);
    97     mars->Associate(this);
    98 
    99     TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
    100     TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
    101 
    102     fList->Add(lay1);
    103     fList->Add(lay2);
    104 
    105     top->AddFrame(magic, lay1);
    106     top->AddFrame(mars,  lay2);
     90    const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm");
     91    if (pic1)
     92    {
     93        TGPictureButton *magic = new TGPictureButton(top, pic1, kPicMagic);
     94        fList->Add(magic);
     95        magic->Associate(this);
     96        TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
     97        fList->Add(lay1);
     98        top->AddFrame(magic, lay1);
     99    }
     100
     101    const TGPicture *pic2 = fList->GetPicture("marslogo.xpm");
     102    if (pic2)
     103    {
     104        TGPictureButton *mars  = new TGPictureButton(top, pic2, kPicMars);
     105        fList->Add(mars);
     106        mars->Associate(this);
     107        TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
     108        fList->Add(lay2);
     109        top->AddFrame(mars,  lay2);
     110    }
    107111}
    108112
     
    176180    // Create the deletion list
    177181    //
    178     fList = new TList;
     182    fList = new MGList;
    179183    fList->SetOwner();
    180184
     
    230234MMars::~MMars()
    231235{
    232     gClient->FreePicture(fPic1);
    233     gClient->FreePicture(fPic2);
    234 
    235236    delete fList;
    236237
Note: See TracChangeset for help on using the changeset viewer.