]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Issue 20429: [ CEA 345 ] Python split views does not work with VISU
authorvsr <vsr@opencascade.com>
Thu, 27 Aug 2009 06:07:42 +0000 (06:07 +0000)
committervsr <vsr@opencascade.com>
Thu, 27 Aug 2009 06:07:42 +0000 (06:07 +0000)
src/VISU_I/VISU_View_i.cc

index b789176cfd4851f219ef8ad5e86c8ff9d9c6925e..b9f660cecc86764025c6aca2f373b15d0fe9bc14 100644 (file)
@@ -1052,16 +1052,23 @@ namespace VISU {
     ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
   }
 
+  struct TCloseViewEvent: public SALOME_Event
+  {
+    SUIT_ViewWindow* myView;
+    TCloseViewEvent (SUIT_ViewWindow* theView):
+      myView(theView)
+    {}
+    
+    virtual void Execute()
+    {
+      if ( myView ) myView->close();
+    }
+  };
+
   void XYPlot_i::Close()
   {
-    //jfa: may be need to be enclosed in SALOME_Event?
-    SUIT_ViewWindow* aVW = GetViewWindow();
-    if (aVW)
-      aVW->close();
-    //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-    //int aPos = aViews.find(myViewWindow);
-    //if (aPos >= 0)
-    //  myViewWindow->close();
+    ProcessVoidEvent(new TCloseViewEvent(GetViewWindow()));
+    QApplication::sendPostedEvents();
   }
 
   XYPlot_i::~XYPlot_i() {
@@ -1866,16 +1873,10 @@ namespace VISU {
 
   void View3D_i::Close()
   {
-    //jfa: may be need to be enclosed in SALOME_Event?
-    SUIT_ViewWindow* aVW = GetViewWindow();
-    if (aVW)
-      aVW->close();
-    //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-    //int aPos = aViews.find(myViewWindow);
-    //if (aPos >= 0)
-    //  myViewWindow->close();
+    ProcessVoidEvent(new TCloseViewEvent(GetViewWindow()));
+    QApplication::sendPostedEvents();
   }
-
+  
   View3D_i::~View3D_i()
   {
     if(MYDEBUG) MESSAGE("View3D_i::~View3D_i");