Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 9178)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 9185)
@@ -296,4 +296,14 @@
         switch (fDisplay->CheckStatus())
         {
+        case MStatusDisplay::kLoopPause:
+            fDisplay->SetStatusLine1("Paused.");
+            while (fDisplay && fDisplay->CheckStatus()==MStatusDisplay::kLoopPause)
+            {
+                gSystem->ProcessEvents();
+                gSystem->Sleep(1);
+            }
+            break;
+        case MStatusDisplay::kLoopStep:
+            fDisplay->SetPause();
         case MStatusDisplay::kLoopNone:
             break;
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 9178)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 9185)
@@ -326,6 +326,11 @@
     //
     MGPopupMenu *loopmenu = new MGPopupMenu(gClient->GetRoot());
-    loopmenu->AddEntry("&Stop", kLoopStop);
+    loopmenu->AddEntry("&Pause",       kLoopPause);
+    loopmenu->AddEntry("Single S&tep", kLoopStep);
+    loopmenu->AddSeparator();
+    loopmenu->AddEntry("&Stop",  kLoopStop);
     loopmenu->Associate(this);
+
+    loopmenu->DisableEntry(kLoopStep);
 
     //
@@ -368,12 +373,12 @@
     fList->Add(layitem);
 
-    MGMenuBar *menubar = new MGMenuBar(this, 1, 1, kHorizontalFrame);
-    menubar->AddPopup("&File", filemenu, layitem);
-    menubar->AddPopup("Lo&g",  logmenu,  layitem);
-    menubar->AddPopup("&Size", sizemenu, layitem);
-    menubar->AddPopup("&Tab",  tabmenu,  layitem);
-    menubar->AddPopup("&Loop", loopmenu, layitem);
-    menubar->BindKeys(this);
-    AddFrame(menubar);
+    fMenuBar = new MGMenuBar(this, 1, 1, kHorizontalFrame);
+    fMenuBar->AddPopup("&File", filemenu, layitem);
+    fMenuBar->AddPopup("Lo&g",  logmenu,  layitem);
+    fMenuBar->AddPopup("&Size", sizemenu, layitem);
+    fMenuBar->AddPopup("&Tab",  tabmenu,  layitem);
+    fMenuBar->AddPopup("&Loop", loopmenu, layitem);
+    fMenuBar->BindKeys(this);
+    AddFrame(fMenuBar);
 
     //
@@ -394,5 +399,5 @@
     fList->Add(loopmenu);
     fList->Add(sizemenu);
-    fList->Add(menubar);
+    fList->Add(fMenuBar);
     fList->Add(tabmenu);
     fList->Add(logmenu);
@@ -663,4 +668,23 @@
 {
     SetStatusLine2(MString::Format("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle()));
+}
+
+// --------------------------------------------------------------------------
+//
+// Get TGPopupMenu as defined by name from fMenuBar
+//
+TGPopupMenu *MStatusDisplay::GetPopup(const char *name)
+{
+    if (!fMenuBar)
+        return 0;
+
+    TGPopupMenu *m = fMenuBar->GetPopup(name);
+    if (!m)
+    {
+        *fLog << warn << name << " doesn't exist in menu bar." << endl;
+        return 0;
+    }
+
+    return m;
 }
 
@@ -1541,4 +1565,31 @@
     switch (id)
     {
+    case kLoopPause:
+        {
+            TGPopupMenu *m = GetPopup("Loop");
+            if (!m)
+                return kTRUE;
+
+            if (fStatus==kLoopNone)
+            {
+                fStatus = (Status_t)kLoopPause;
+                m->CheckEntry(kLoopPause);
+                m->EnableEntry(kLoopStep);
+                return kTRUE;
+            }
+            if (fStatus==kLoopPause)
+            {
+                fStatus = (Status_t)kLoopNone;
+                m->UnCheckEntry(kLoopPause);
+                m->DisableEntry(kLoopStep);
+                return kTRUE;
+            }
+        }
+        return kTRUE;
+
+    case kLoopStep:
+        fStatus = (Status_t)kLoopStep;
+        return kTRUE;
+
     case kLoopStop:
     case kFileClose:
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 9178)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 9185)
@@ -20,4 +20,5 @@
 class MLog;
 class MGList;
+class MGMenuBar;
 class MStatusArray;
 class MParContainer;
@@ -32,4 +33,5 @@
 class TGTextView;
 class TGStatusBar;
+class TGPopupMenu;
 class TGTabElement;
 class TGProgressBar;
@@ -51,5 +53,5 @@
         kFileClose, kFileExit, kFileReset,
         // kLoop
-        kLoopNone, kLoopStop,
+        kLoopNone, kLoopPause, kLoopStep, kLoopStop,
         // kTab
         kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsPDF, kTabSaveAsSVG,
@@ -97,4 +99,5 @@
     TMutex *fMutex;
 
+    MGMenuBar   *fMenuBar;
     TGStatusBar *fStatusBar;
 
@@ -141,4 +144,7 @@
     void RemoveTab(int i);
     void SetStatusLine(const char *txt, Int_t idx);
+
+    // Menu helper functions
+    TGPopupMenu *GetPopup(const char *name);
 
     // Drawing helper
@@ -291,4 +297,5 @@
      Status_t CheckStatus() const { return fStatus; }
      void ClearStatus() { fStatus = kLoopNone; }
+     void SetPause() { fStatus = kLoopPause; }
 
      void Lock() { fIsLocked++; }
