Index: trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1039)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1050)
@@ -33,5 +33,6 @@
 #include <TGMsgBox.h>       // TGMsgBox
 #include <TGListBox.h>      // TGListBox
-#include <TGComboBox.h>     // TGComboBox
+#include <TGTextEntry.h>    // TGTextEntry
+#include <TGFSComboBox.h>   // TGFSComboBox, TGFSLboxEntry
 #include <TGProgressBar.h>  // TGHProgressBar
 #include <TGFSContainer.h>  // TGFileContainer
@@ -47,9 +48,10 @@
 
 enum {
-    M_FILE_CLOSE          = 0x1000,
-    M_PBUTTON_CDIR_UP     = 0x1001,
-    M_PBUTTON_LIST_MODE   = 0x1002,
-    M_PBUTTON_DETAIL_MODE = 0x1003,
-    M_DIRBOX              = 0x1004
+    kFileClose,
+    kButDirUp,
+    kButListMode,
+    kButDetailMode,
+    kCBDirectory,
+    kTEFileName
 };
 
@@ -60,6 +62,5 @@
     //
     TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());
-    filemenu->AddEntry("Close", M_FILE_CLOSE);
-    //filemenu->Associate(this);
+    filemenu->AddEntry("Close", kFileClose);
     fList->Add(filemenu);
 
@@ -110,5 +111,5 @@
     // Create Dir-Listbox and buttons in first frame
     //
-    fDir = new TGComboBox(frame, M_DIRBOX);
+    fDir = new TGFSComboBox(frame, kCBDirectory);
     fDir->Resize(350, 20);
 
@@ -123,7 +124,7 @@
     // Create the corresponding picture buttons
     //
-    fCdup     = new TGPictureButton(frame, fPic1, M_PBUTTON_CDIR_UP);
-    fListMode = new TGPictureButton(frame, fPic2, M_PBUTTON_LIST_MODE);
-    fDetail   = new TGPictureButton(frame, fPic3, M_PBUTTON_DETAIL_MODE);
+    fCdup     = new TGPictureButton(frame, fPic1, kButDirUp);
+    fListMode = new TGPictureButton(frame, fPic2, kButListMode);
+    fDetail   = new TGPictureButton(frame, fPic3, kButDetailMode);
 
     //
@@ -163,11 +164,14 @@
     //    padding:   5, 5, 5, 5
     //
-    TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
+    TGLayoutHints *laydir = new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsCenterY); //, 5, 5, 5, 5);
+    fList->Add(laydir);
+
+    TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);
     fList->Add(layout);
 
-    frame->AddFrame(fDir,      layout);
-    frame->AddFrame(fCdup,     layout);
+    frame->AddFrame(fDir,      laydir);
     frame->AddFrame(fListMode, layout);
     frame->AddFrame(fDetail,   layout);
+    frame->AddFrame(fCdup,     layout);
 }
 
@@ -193,5 +197,5 @@
     fFileCont->Sort(kSortByName);
 
-    TGLayoutHints *layview = new TGLayoutHints(kLHintsTop|kLHintsExpandX|kLHintsExpandY, 5, 5, 5, 5);
+    TGLayoutHints *layview = new TGLayoutHints(kLHintsTop|kLHintsExpandX|kLHintsExpandY); //, 5, 5, 5, 5);
     fList->Add(layview);
 
@@ -206,24 +210,31 @@
     // Create three frames for the first tab
     //
-    TGCompositeFrame *tab1  = new TGCompositeFrame(frame, 100, 100, kHorizontalFrame);
-    TGCompositeFrame *tab1a = new TGCompositeFrame(frame, 100, 100, kHorizontalFrame);
-    TGCompositeFrame *tab1b = new TGCompositeFrame(frame, 100, 100, kVerticalFrame);
-
-    TGLayoutHints *laytab1b = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 5, 5, 5, 5);
-    TGLayoutHints *laytab1  = new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5);
-
-    fList->Add(laytab1b);
+    TGHorizontalFrame *tab1a = new TGHorizontalFrame(frame, 100, 100);
+    TGHorizontalFrame *tab1b = new TGHorizontalFrame(frame, 100, 100);
+    TGVerticalFrame   *tab2  = new TGVerticalFrame  (frame, 100, 100);
+
+    TGLayoutHints *laytab1  = new TGLayoutHints(kLHintsNormal|kLHintsExpandX,  10, 10, 10);
+    TGLayoutHints *laytab2  = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 10, 10, 10, 10);
+    TGLayoutHints *layentry = new TGLayoutHints(kLHintsNormal|kLHintsExpandX); //,  5, 5, 5);
+
+    frame->AddFrame(tab1a, laytab1);
+    frame->AddFrame(tab1b, laytab1);
+    frame->AddFrame(tab2,  laytab2);
+
+    fEntry = new TGTextEntry(tab1a, "", kTEFileName);
+    fEntry->Resize(350, 20);
+    fEntry->Associate(this);
+    tab1a->AddFrame(fEntry, layentry);
+
+    CreateDirListMenu(tab1b);
+    CreateDirListBox(tab2);
+
     fList->Add(laytab1);
-
-    frame->AddFrame(tab1a);
-    frame->AddFrame(tab1b, laytab1b);
-    frame->AddFrame(tab1,  laytab1);
-
-    fList->Add(tab1);
+    fList->Add(laytab2);
     fList->Add(tab1a);
     fList->Add(tab1b);
-
-    CreateDirListMenu(tab1a);
-    CreateDirListBox(tab1b);
+    fList->Add(tab2);
+    fList->Add(layentry);
+    fList->Add(fEntry);
 }
 
@@ -394,12 +405,47 @@
     fFileCont->ChangeDirectory(txt?txt:gSystem->WorkingDirectory());
 
-    const char  *dir = fFileCont->GetDirectory();
-    //    const UInt_t num = fDir->GetSelected()+1;
-
-    //
-    // FIXME: This is a big workaround!
-    //
-    fDir->InsertEntry(dir, -1/*num*/, -1);
-    fDir->Select(-1/*num*/);
+    const char *dir = fFileCont->GetDirectory();
+    fDir->Update(dir);
+}
+
+void MBrowser::SetFileName(const char *name)
+{
+    //
+    // determine the file type by extensions
+    //
+    const char *ext=strrchr(name, '.');
+
+    Bool_t failed = kFALSE;
+
+    if (!ext)
+        failed = kTRUE;
+    else
+        if (strcasecmp(ext, ".root"))
+            failed = kTRUE;
+
+    char *fname=NULL;
+    if (!failed)
+    {
+        const char *dir = fFileCont->GetDirectory();
+
+        fname = Form("%s/%s", dir, name);
+
+        failed = gSystem->AccessPathName(fname, kFileExists);
+    }
+
+    if (!failed)
+        strcpy(fInputFile, fname);
+    else
+        fname = Form(fInputFile);
+
+    char *slash = strrchr(fname, '/');
+
+    fEntry->SetText(slash ? slash+1 : "");
+
+    if (!slash)
+        return;
+
+    *slash = '\0';
+    ChangeDir(fname);
 }
 
@@ -410,4 +456,11 @@
   switch (GET_MSG(msg))
   {
+  case kC_TEXTENTRY:
+      if (GET_SUBMSG(msg)!=kTE_ENTER)
+          return kTRUE;
+
+      SetFileName(fEntry->GetText());
+      return kTRUE;
+
   case kC_COMMAND:
       switch (GET_SUBMSG(msg))
@@ -417,5 +470,5 @@
           switch (parm1)
           {
-          case M_PBUTTON_CDIR_UP :
+          case kButDirUp :
               //
 	      //  goto the parent directory
@@ -424,10 +477,10 @@
 	      return kTRUE;
 	    
-	    case M_PBUTTON_LIST_MODE:
+	    case kButListMode:
 	      fFileView->SetViewMode(kLVList);
               fDetail->SetState(kButtonUp) ;
               return kTRUE;
 	      
-          case M_PBUTTON_DETAIL_MODE:
+          case kButDetailMode:
               fFileView->SetViewMode(kLVDetails);
               fListMode->SetState(kButtonUp);
@@ -441,10 +494,12 @@
           // But to do this we need the number of entries in the list.
           //
-          if (parm1 == M_DIRBOX)
-              ChangeDir(((TGTextLBEntry*)fDir->GetSelectedEntry())->GetText()->GetString());
+          if (parm1 != kCBDirectory)
+              return kTRUE;
+
+          ChangeDir(((TGTreeLBEntry*)fDir->GetSelectedEntry())->GetPath()->GetString());
           return kTRUE;
 
 	case kCM_MENU:
-	  if (parm1==M_FILE_CLOSE)
+	  if (parm1==kFileClose)
               CloseWindow();
           return kTRUE;
@@ -465,8 +520,5 @@
           //
 
-          if (parm1 != kButton1)
-              return kTRUE;
-
-          if (fFileCont->NumSelected() != 1 )
+          if (parm1 != kButton1 || fFileCont->NumSelected() != 1)
               return kTRUE;
 
@@ -489,29 +541,5 @@
           }
 
-          //
-          // file is no directory, is a file
-          //    determine the file type by extensions
-          //
-          const char *extension=strrchr(str, '.');
-
-          if (!extension)
-              return kTRUE;
-
-          const char *dir = fFileCont->GetDirectory();
-
-          if (!strcasecmp(extension, ".ps")) // postscript file
-          {
-              char *cmd = new char[strlen(dir)+strlen(str)+40];
-              sprintf(cmd, "gv %s/%s &", dir, str);
-              gSystem->Exec(cmd);
-              delete cmd;
-              return kTRUE;
-          }
-
-          if (!strcasecmp(extension, ".root"))
-          {
-              sprintf(fInputFile, "%s/%s", dir, str);
-              return kTRUE;
-          }
+          SetFileName(str);
           return kTRUE;
       }
Index: trunk/MagicSoft/Mars/mmain/MBrowser.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 1039)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 1050)
@@ -13,5 +13,6 @@
 class TGTab;
 class TGListView;
-class TGComboBox;
+class TGTextEntry;
+class TGFSComboBox;
 class TGProgressBar;
 class TGPictureButton;
@@ -23,5 +24,6 @@
     TGTab            *fTabs;
 
-    TGComboBox       *fDir;
+    TGFSComboBox     *fDir;
+    TGTextEntry      *fEntry;
 
     TGPictureButton  *fCdup;
@@ -42,4 +44,6 @@
     void CreateDirListMenu(TGCompositeFrame *frame);
     void CreateDirListBox(TGCompositeFrame *frame);
+
+    void SetFileName(const char *name);
 
 protected:
Index: trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1039)
+++ trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1050)
@@ -30,8 +30,9 @@
 #include <TGTab.h>         // TGTab
 #include <TGMenu.h>        // TGPopupMenu
+#include <TSystem.h>       // gSystem->Exec
 #include <TGMsgBox.h>      // TGMsgBox
 #include <TGButton.h>      // TGPictureButton
 #include <TG3DLine.h>      // TGHorizontal3DLine
-                           // use TGSplitter.h for root<3.00
+
 #include "MEvtDisp.h"
 #include "MAnalysis.h"
@@ -289,11 +290,9 @@
 
             case M_PICTURE_MAGIC:
-                DisplWarning("Please open a Netscape to the MAGIC homepage\n"
-                             "http://hegra1.mppmu.mpg.de/MAGICWeb/");
+                gSystem->Exec("netscape http://hegra1.mppmu.mpg.de/MAGICWeb/ &");
                 return kTRUE;
 
             case M_PICTURE_MARS:
-                DisplWarning("Please open a Netscape to the MARS homepage\n"
-                             "http://magic.uni-sw.gwdg.de/mars/");
+                gSystem->Exec("netscape http://magic.uni-sw.gwdg.de/mars/ &");
                 return kTRUE;
             }
