Index: trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 1052)
+++ trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 1057)
@@ -46,7 +46,7 @@
 enum
 {
-    M_RBUT_RAW    = 0x1000,
-    M_RBUT_CLEAN  = 0x1001,
-    M_CBUT_HILLAS = 0x1002
+    kRButRawEvt,
+    kRButCleanedEvt,
+    kCButHillas
 };
 
@@ -63,7 +63,7 @@
     fList->Add(group);
 
-    TGRadioButton *but1 = new TGRadioButton(group, "Raw Events",      M_RBUT_RAW);
-    TGRadioButton *but2 = new TGRadioButton(group, "Cleaned Events",  M_RBUT_CLEAN);
-    TGCheckButton *but3 = new TGCheckButton(fTab1, "Display Ellipse", M_CBUT_HILLAS);
+    TGRadioButton *but1 = new TGRadioButton(group, "Raw Events",      kRButRawEvt);
+    TGRadioButton *but2 = new TGRadioButton(group, "Cleaned Events",  kRButCleanedEvt);
+    TGCheckButton *but3 = new TGCheckButton(fTab1, "Display Ellipse", kCButHillas);
 
     but2->SetState(kButtonDown);
@@ -73,8 +73,14 @@
     fDisplayHillas = kTRUE;
 
-    /* FXIME:
-     fList->Add(but1);
-     fList->Add(but2);
-    */
+    /*
+     WARNING:
+     Bacause of some strage and hidden dependencies the
+     GetMaiFrame call in the destructor of TGButton may fail if some
+     of the other gui elemts is deleted first.
+     AddFirst adds the buttons at the beginning of the deletion list,
+     this seems to work.
+     */
+    fList->AddFirst(but1);
+    fList->AddFirst(but2);
 
     but1->Associate(this);
@@ -223,5 +229,5 @@
             switch (parm1)
             {
-            case M_CBUT_HILLAS:
+            case kCButHillas:
                 fDisplayHillas = !fDisplayHillas;
                 UpdateDisplay();
@@ -233,10 +239,10 @@
             switch (parm1)
             {
-            case M_RBUT_RAW:
+            case kRButRawEvt:
                 fDisplayRaw = kTRUE;
                 UpdateDisplay();
                 return kTRUE;
 
-            case M_RBUT_CLEAN:
+            case kRButCleanedEvt:
                 fDisplayRaw = kFALSE;
                 UpdateDisplay();
