Index: trunk/MagicSoft/Mars/Makefile.conf.general
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.general	(revision 2053)
+++ trunk/MagicSoft/Mars/Makefile.conf.general	(revision 2054)
@@ -12,8 +12,14 @@
 #
 
-DEFINES	  = -D__MARS__ -DMARSVER=\"\<cvs\>\" -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF)
+#
+# You can use this flags to further costumize compilation:
+#   export MARSDEFINES="-DHAVE_DARKBACKGROUND -DHAVE_XPM"
+#   export MARSFLAGS=
+#   export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib"
+#
+DEFINES	  = -DMARSVER=\"\<cvs\>\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES)
 
 CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
-CFLAGS    = $(CXXFLAGS)
+CFLAGS    = $(CXXFLAGS) $(MARSFLAGS)
 FFLAGS    = $(CXXFLAGS)
 
Index: trunk/MagicSoft/Mars/Makefile.conf.linux
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 2053)
+++ trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 2054)
@@ -21,5 +21,5 @@
 #
 OPTIM    = -O5 -Wall -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
-DEBUG    =
+DEBUG    = 
 ARCHDEF  = -D__LINUX__
 
@@ -27,5 +27,5 @@
 # For producing gmon.out use    '-pg'
 
-MARS_LIB = -Llib $(SUBDIRS:%=-l%)
+MARS_LIB = -Llib $(SUBDIRS:%=-l%) $(MARSLIBS)
 INCLUDES = -I. $(SUBDIRS:%=-I%)
 
Index: trunk/MagicSoft/Mars/Makefile.conf.linux-gnu
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.linux-gnu	(revision 2053)
+++ trunk/MagicSoft/Mars/Makefile.conf.linux-gnu	(revision 2054)
@@ -24,8 +24,12 @@
 ARCHDEF  = -D__LINUX__
 
+# To be tested:
+# OPTIM    = -pipe  
+# OPTIM2   = -fomit-frame-pointer -ffast-math -march=i686 -mcpu=i686
+
 # For debugging information use '-g'
 # For producing gmon.out use    '-pg'
 
-MARS_LIB = -Llib $(SUBDIRS:%=-l%)
+MARS_LIB = -Llib $(SUBDIRS:%=-l%)  $(MARSLIBS)
 INCLUDES = -I. $(SUBDIRS:%=-I%)
 
Index: trunk/MagicSoft/Mars/Makefile.conf.osf1
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.osf1	(revision 2053)
+++ trunk/MagicSoft/Mars/Makefile.conf.osf1	(revision 2054)
@@ -27,5 +27,5 @@
 ARCHDEF  = -D__OSF__
 
-MARS_LIB = -Llib $(SUBDIRS/*/-l&)
+MARS_LIB = -Llib $(SUBDIRS/*/-l&)  $(MARSLIBS)
 INCLUDES = -I. $(SUBDIRS/*/-I&)
 
Index: trunk/MagicSoft/Mars/Makefile.conf.osf5.1
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.osf5.1	(revision 2053)
+++ trunk/MagicSoft/Mars/Makefile.conf.osf5.1	(revision 2054)
@@ -27,5 +27,5 @@
 ARCHDEF  = -D__OSF__
 
-MARS_LIB = -Llib $(SUBDIRS/*/-l&)
+MARS_LIB = -Llib $(SUBDIRS/*/-l&)  $(MARSLIBS)
 INCLUDES = -I. $(SUBDIRS/*/-I&)
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 2053)
+++ trunk/MagicSoft/Mars/NEWS	(revision 2054)
@@ -56,4 +56,6 @@
 
    - added (event-)weights to fill histograms
+
+   - colors in logging output to screen
 
 
Index: trunk/MagicSoft/Mars/mars.cc
===================================================================
--- trunk/MagicSoft/Mars/mars.cc	(revision 2053)
+++ trunk/MagicSoft/Mars/mars.cc	(revision 2054)
@@ -11,6 +11,5 @@
 #include "MParContainer.h"
 
-//#define HAVE_LOGO 1
-#ifdef HAVE_LOGO
+#ifdef HAVE_XPM
 #include "MLogo.h"
 #endif
@@ -28,5 +27,5 @@
 {
     gLog << "Sorry the usage is:" << endl;
-    gLog << "   mars [-vn]" << endl << endl;
+    gLog << "   mars [-v#]" << endl << endl;
     gLog << "     -v0: verbosity level: as less as possible" << endl;
     gLog << "     -v1: errors only"                          << endl;
@@ -37,5 +36,5 @@
 int main(int argc, char **argv)
 {
-#ifdef HAVE_LOGO
+#ifdef HAVE_XPM
     MLogo logo;
     logo.Popup();
@@ -106,5 +105,5 @@
     TApplication app("MarsApp", &argc, argv);
 
-#ifdef HAVE_LOGO
+#ifdef HAVE_XPM
     logo.Popdown();
 #endif
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2053)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2054)
@@ -89,4 +89,19 @@
 // check for TObjectWarning, TObject::Info, gErrorIgnoreLevel
 
+const char MLog::kESC = '\033'; // (char)27
+const char *const MLog::kEsc       = "\033[";
+const char *const MLog::kReset     = "\033[0m";
+const char *const MLog::kRed       = "\033[31m";
+const char *const MLog::kGreen     = "\033[32m";
+#ifdef HAVE_DARKBACKGROUND
+const char *const MLog::kYellow    = "\033[33m\033[1m";
+#else
+const char *const MLog::kYellow    = "\033[33m";
+#endif
+const char *const MLog::kUnderline = "\033[4m";;
+const char *const MLog::kBlink     = "\033[5m";;
+const char *const MLog::kBright    = "\033[1m";;
+const char *const MLog::kDark      = "\033[2m";;
+
 //
 // This is the definition of the global log facility
@@ -180,4 +195,28 @@
 }
 
+void MLog::Output(ostream &out, int len)
+{
+    if (!TestBit(eNoColors))
+        switch (fOutputLevel)
+        {
+        case 0:  out << MLog::kReset;   break;  // all
+        case 1:  out << MLog::kRed;     break;  // err
+        case 2:  out << MLog::kYellow;  break;  // warn
+        case 3:  out << MLog::kGreen;   break;  // inf
+        }
+
+    // Check for EOL
+    const Bool_t endline = fBase[len-1]=='\n';
+    // output text to screen (without trailing '\0' or '\n')
+    out << TString(fBase, len-1);
+    // reset colors if working with colors
+    if (!TestBit(eNoColors))
+        out << kReset;
+    // output EOL of check found EOL
+    if (endline)
+        out << '\n';
+    out.flush();
+}
+
 // --------------------------------------------------------------------------
 //
@@ -198,8 +237,8 @@
 
     if (fDevice&eStdout)
-        cout.write(fBase, len);
+        Output(cout, len);
 
     if (fDevice&eStderr)
-        cerr.write(fBase, len);
+        Output(cerr, len);
 
     if (fDevice&eFile && fout)
@@ -289,5 +328,8 @@
 
     if (fDevice&eStdout)
+    {
+        cout << kReset;
         cout.flush();
+    }
 
     if (fDevice&eStderr)
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2053)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2054)
@@ -23,7 +23,24 @@
 {
 public:
-    typedef enum _flags { eStdout = 0x1, eStderr = 0x2, eFile = 0x4, eGui = 0x8 } Flags_t;
+    typedef enum _flags {
+        eStdout   = 0x001,
+        eStderr   = 0x002,
+        eFile     = 0x004,
+        eGui      = 0x008,
+        eNoColors = 0x400  //BIT(15)
+    } Flags_t;
 
 private:
+    static const char kESC;
+    static const char *const kEsc;
+    static const char *const kReset;
+    static const char *const kRed;
+    static const char *const kGreen;
+    static const char *const kYellow;
+    static const char *const kUnderline;
+    static const char *const kBlink;
+    static const char *const kBright;
+    static const char *const kDark;
+
     char        fBuffer;      //!
     char        fBase[bsz+1]; //! Buffer to store the data in
@@ -46,6 +63,5 @@
     TString  **fGuiLines;     //! Lines to pipe to gui
     Int_t      fNumLines;     //!
-//    Bool_t     fGuiLineFlushed;
-    TString    fGuiLine;  //!
+    TString    fGuiLine;      //!
 
 #ifdef _REENTRANT
@@ -63,4 +79,5 @@
     void ReallocateFile(const char *f);
     void CheckFlag(Flags_t chk, int flag);
+    void Output(ostream &out, int len);
 
 public:
@@ -143,4 +160,6 @@
     void SetNullOutput(Bool_t n=kTRUE) { fIsNull = n; }
 
+    void SetNoColors(Bool_t flag=kTRUE) { flag ? SetBit(eNoColors) : ResetBit(eNoColors); }
+
     ClassDef(MLog, 0) // This is what we call 'The logging system'
 };
Index: trunk/MagicSoft/Mars/mbase/MLogo.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogo.cc	(revision 2053)
+++ trunk/MagicSoft/Mars/mbase/MLogo.cc	(revision 2054)
@@ -32,4 +32,5 @@
 //                                                                          //
 //////////////////////////////////////////////////////////////////////////////
+#ifdef HAVE_XPM
 #include "MLogo.h"
 
@@ -123,7 +124,7 @@
                                       mag1, &logo, 0, &attr);
 #else
-#include "../marslogo_neu.xpm"
+#include "../marslogo.xpm"
     int ret = XpmCreatePixmapFromData(fDisplay, fLogoWindow,
-                                      marslogo_neu_xpm, &logo, 0, &attr);
+                                      marslogo, &logo, 0, &attr);
 #endif
     XpmFreeAttributes(&attr);
@@ -206,2 +207,3 @@
     }
 }
+#endif
Index: trunk/MagicSoft/Mars/mbase/MLogo.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogo.h	(revision 2053)
+++ trunk/MagicSoft/Mars/mbase/MLogo.h	(revision 2054)
@@ -1,4 +1,6 @@
 #ifndef MARS_MLogo
 #define MARS_MLogo
+
+#ifdef HAVE_XPM
 
 #ifndef __CINT__
@@ -31,5 +33,5 @@
 };
 
-#endif
-
-#endif
+#endif // __CINT__
+#endif // HAVE_XPM
+#endif // MARS_MLogo
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 2053)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 2054)
@@ -50,4 +50,5 @@
            MContinue.cc \
            MPrint.cc \
+           MLogo.cc \
            MLogManip.cc
 
Index: trunk/MagicSoft/Mars/mmain/MGMenu.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MGMenu.cc	(revision 2053)
+++ trunk/MagicSoft/Mars/mmain/MGMenu.cc	(revision 2054)
@@ -213,11 +213,11 @@
         // was pressed close the popup.
         //
-        if (!rc || event->fCode==9/*ESC*/)
-        {
-            f.SetState(kFALSE);
-            gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);  // ungrab pointer
-            fCurrent = 0;
-        }
-
+        if (rc && event->fCode!=9/*ESC*/)
+            return kTRUE;
+
+        f.SetState(kFALSE);
+        gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);  // ungrab pointer
+        gVirtualX->SetKeyAutoRepeat(kTRUE); // set in TGMainFrame::HandleKey
+        fCurrent = 0;
         return kTRUE;
     }
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2053)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2054)
@@ -80,4 +80,5 @@
 #include <TGButton.h>             // TGPictureButton
 #include <TGListBox.h>            // TGListBox
+#include <TGStatusBar.h>          // TGStatusBar
 #include <TGProgressBar.h>        // TGHProgressBar
 
@@ -219,4 +220,11 @@
         f->AddFrame(mars, lay2);
     }
+    /*
+     TGShutter *s = new TGShutter(f);
+     fList->Add(s);
+     f->AddFrame(s, lay);
+     s->AddItem(new TGShutterItem(s, new TGHotString("Hallo1")));
+     s->AddItem(new TGShutterItem(s, new TGHotString("Hallo2")));
+     */
 
     // Add date and time
@@ -304,5 +312,5 @@
 
     // Add fTab to Frame
-    TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 5, 6, 5);
+    TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 5, 5, 5);
     AddFrame(fTab, laytabs);
 
@@ -317,5 +325,5 @@
 void MStatusDisplay::AddProgressBar()
 {
-    TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 5, 6, 5, 5);
+    TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5);
     fList->Add(laybar);
 
@@ -329,35 +337,17 @@
 // --------------------------------------------------------------------------
 //
-// Adds the status lines to the GUI
-//
-void MStatusDisplay::AddStatusLines()
-{
-    TGHorizontalFrame *hf = new TGHorizontalFrame(this, 1, 1);
-
-    TGCompositeFrame *f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame);
-
-    fLine1 = new TGLabel(f, "");
-
-    TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 0, 5);
-    f->AddFrame(fLine1, lay);
-    hf->AddFrame(f, lay);
-
-    fList->Add(f);
-    fList->Add(fLine1);
-    fList->Add(lay);
-
-    f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame);
-
-    fLine2 = new TGLabel(f, "");
-    f->AddFrame(fLine2, lay);
-    hf->AddFrame(f, lay);
-
-    TGLayoutHints *layf = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 0, 0, 3);
-    AddFrame(hf, layf);
-
-    fList->Add(layf);
-    fList->Add(f);
-    fList->Add(fLine2);
-    fList->Add(hf);
+// Adds the status bar to the GUI
+//
+void MStatusDisplay::AddStatusBar()
+{
+    fStatusBar = new TGStatusBar(this, 1, 1);
+
+    fStatusBar->SetParts(2);
+
+    TGLayoutHints *layb = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 4, 0, 3);
+    AddFrame(fStatusBar, layb);
+
+    fList->Add(fStatusBar);
+    fList->Add(layb);
 }
 
@@ -368,6 +358,6 @@
 void MStatusDisplay::SetStatusLine1(const char *txt)
 {
-    fLine1->SetText(txt);
-    gClient->ProcessEventsFor(fLine1);
+    fStatusBar->SetText(txt, 0);
+    gClient->ProcessEventsFor(fStatusBar);
 }
 
@@ -378,6 +368,6 @@
 void MStatusDisplay::SetStatusLine2(const char *txt)
 {
-    fLine2->SetText(txt);
-    gClient->ProcessEventsFor(fLine2);
+    fStatusBar->SetText(txt, 1);
+    gClient->ProcessEventsFor(fStatusBar);
 }
 
@@ -404,7 +394,9 @@
 //
 MStatusDisplay::MStatusDisplay(Long_t t)
-: TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL)
+: TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL)
 {
     gROOT->GetListOfSpecials()->Add(this);
+    gROOT->GetListOfCleanups()->Add(this);
+
 
     //
@@ -434,5 +426,5 @@
     AddTabs();
     AddProgressBar();
-    AddStatusLines();
+    AddStatusBar();
 
     //
@@ -447,9 +439,5 @@
     MapWindow();
 
-    //lient->ProcessEventsFor(this);
     gSystem->ProcessEvents();
-
-    //TSeqCollection   *GetListOfCleanups() const   {return fCleanups;}
-
 }
 
@@ -466,4 +454,5 @@
 
     gROOT->GetListOfSpecials()->Remove(this);
+    gROOT->GetListOfCleanups()->Remove(this);
 } 
 
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2053)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2054)
@@ -23,6 +23,6 @@
 
 class TGTab;
-class TGLabel;
 class TGListBox;
+class TGStatusBar;
 class TGProgressBar;
 class TGHProgressBar;
@@ -69,6 +69,5 @@
     TTimer fTimer;
 
-    TGLabel *fLine1;
-    TGLabel *fLine2;
+    TGStatusBar *fStatusBar;
 
     Status_t fStatus;
@@ -86,5 +85,5 @@
     void AddLogTab();
     void AddTabs();
-    void AddStatusLines();
+    void AddStatusBar();
 
     TCanvas *GetCanvas(TGCompositeFrame *f) const;
