Index: /trunk/SophyaPI/PI/Tests/pit0.cc
===================================================================
--- /trunk/SophyaPI/PI/Tests/pit0.cc	(revision 1262)
+++ /trunk/SophyaPI/PI/Tests/pit0.cc	(revision 1263)
@@ -227,4 +227,7 @@
 char strg[64];
 
+ printf("DBG-PITApp::Process() Msg= %d (%d - %d) Sender=%lx (This=%lx) \n", 
+	(int)msg, (int)UserMsg(msg),(int)ModMsg(msg), (long)sender, (long)this);
+
 // Gestion des actions en fonctions des messages
 
Index: /trunk/SophyaPI/PI/Tests/pitgr.cc
===================================================================
--- /trunk/SophyaPI/PI/Tests/pitgr.cc	(revision 1262)
+++ /trunk/SophyaPI/PI/Tests/pitgr.cc	(revision 1263)
@@ -113,4 +113,7 @@
 int i,j;
 
+ printf("DBG-PITApp::Process() Msg= %d (%d - %d) Sender=%lx (This=%lx) \n", 
+	(int)msg, (int)UserMsg(msg),(int)ModMsg(msg), (long)sender, (long)this);
+
 if ( ( ModMsg(msg) == PIMsg_Active) || (ModMsg(msg) == PIMsg_Close) ) {
   PIWdg *sndw;
@@ -122,4 +125,8 @@
       mCurW = NULL; }
     else  mCurW = (PIWindow *)sender;
+  }
+  else if (sender == this) {
+    printf(" PIMsg_Close from Application !!! \n");
+    return;
   }
 }
@@ -369,6 +376,6 @@
 
     default :
-//      printf("PITApp::Process() Msg= %d (%d - %d)??? \n", 
-//            (int)msg, (int)UserMsg(msg),(int)ModMsg(msg));
+      printf("PITApp::Process() Msg= %d (%d - %d)??? \n", 
+            (int)msg, (int)UserMsg(msg),(int)ModMsg(msg));
      break;
     }
@@ -402,4 +409,5 @@
 app->Run();
 
+ printf("Apres app->Run(); \n");
 delete cmap;
 delete app;
Index: /trunk/SophyaPI/PI/piapplx.cc
===================================================================
--- /trunk/SophyaPI/PI/piapplx.cc	(revision 1262)
+++ /trunk/SophyaPI/PI/piapplx.cc	(revision 1263)
@@ -2,4 +2,7 @@
 #include <X11/cursorfont.h>
 #include <X11/IntrinsicP.h>
+#include <X11/Shell.h>
+#include <X11/StringDefs.h>
+#include <Xm/Xm.h>
 #include "piapplx.h"
 #include "picontainerx.h"
@@ -79,4 +82,23 @@
 {
 }
+
+// ---------------------------------------------
+// Fonction pour gestion des close-window
+
+/* Nouvelle-Fonction */
+static int fgactl = 0;
+
+static void CloseWindow (Widget w, XEvent*, String*,Cardinal*)
+{
+XtCallCallbacks(w,  XtNpopdownCallback, NULL);
+}
+
+/* Nouvelle-Fonction */
+static void popdwn_cb_app(Widget /*w*/, XtPointer *usd,  XtPointer * )
+{
+PIApplicationX * app = (PIApplicationX *) usd;
+app->SendSelf(0,PIMsg_Close, NULL) ;
+}
+
 
 /* --Methode-- */
@@ -134,4 +156,33 @@
 
 topwdg->Manage();
+
+// ------------------------------------------------------
+//   Pour la gestion des close window des Window manager 
+
+if (fgactl == 0)    { 
+  XtActionsRec desact = {(char *)"CloseWindow" ,CloseWindow};
+  int szx, szy, szf;
+  XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
+  XtAppAddActions(*appctx, &desact, 1);  
+  Display *mdsp;
+  mdsp = XtDisplay (topwdg->XtWdg()); 
+  Atom wmd;
+  wmd = XInternAtom(mdsp, "WM_DELETE_WINDOW",False);
+  XSetWMProtocols(mdsp, XtWindow(topwdg->XtWdg()), &wmd, 1);
+  fgactl = 1; 
+}
+
+XtTranslations trans;
+trans = XtParseTranslationTable("<Message>WM_PROTOCOLS:CloseWindow()");
+XtOverrideTranslations(topwdg->XtWdg() , trans);
+Arg warg[2];
+XtSetArg(warg[0], XmNdeleteResponse, XmDO_NOTHING);
+XtSetValues(topwdg->XtWdg(), warg, 1);
+
+XtAddCallback(topwdg->XtWdg(), XtNpopdownCallback,
+	      (XtCallbackProc)popdwn_cb_app, (XtPointer)this);
+
+// ------------------------------------------------------
+
 cur_piapp = this;
 mState = -1;
Index: /trunk/SophyaPI/PI/piversion.h
===================================================================
--- /trunk/SophyaPI/PI/piversion.h	(revision 1262)
+++ /trunk/SophyaPI/PI/piversion.h	(revision 1263)
@@ -2,5 +2,5 @@
 #define PIVERSION_H_SEEN
 
-#define PI_VERSIONNUMBER  2.7
+#define PI_VERSIONNUMBER  2.72
 
 #endif
Index: /trunk/SophyaPI/PI/piwindowx.cc
===================================================================
--- /trunk/SophyaPI/PI/piwindowx.cc	(revision 1262)
+++ /trunk/SophyaPI/PI/piwindowx.cc	(revision 1263)
@@ -20,12 +20,4 @@
 }
 
-
-/* Nouvelle-Fonction */
-static int fgactl = 0;
-
-static void CloseWindow (Widget w, XEvent*, String*,Cardinal*)
-{
-XtCallCallbacks(w,  XtNpopdownCallback, NULL);
-}
 
 /* *** ATTENTION *** La constante ci-dessous PIXMFORMFRACBASE
@@ -80,11 +72,4 @@
                 (XtCallbackProc)popdwn_cb, (XtPointer)this);
 
-  if (fgactl == 0) 
-    { 
-    XtActionsRec desact = {(char *)"CloseWindow" ,CloseWindow};
-    int szx, szy, szf;
-    XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
-    XtAppAddActions(*appctx, &desact, 1);  fgactl = 1; 
-    }
 
   trans = XtParseTranslationTable("<Message>WM_PROTOCOLS:CloseWindow()");
