From: vsr Date: Thu, 27 Aug 2009 06:07:42 +0000 (+0000) Subject: Issue 20429: [ CEA 345 ] Python split views does not work with VISU X-Git-Tag: V5_1_main_20090828~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4991788ed232cc30926521cbac17d3c804de26d;p=modules%2Fvisu.git Issue 20429: [ CEA 345 ] Python split views does not work with VISU --- diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index b789176c..b9f660ce 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -1052,16 +1052,23 @@ namespace VISU { ProcessVoidEvent(new TVoidMemFunEvent(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 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 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");