From 84402056309379c6e5fdefa4f61c2ceb72b63285 Mon Sep 17 00:00:00 2001 From: san Date: Mon, 28 Feb 2005 15:10:50 +0000 Subject: [PATCH] PAL8065 --- src/SUPERVGUI/SUPERVGUI_Main.cxx | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index 33e2a18..d6e4701 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -58,6 +58,23 @@ using namespace std; #include #include +// PAL8065: san -- Safe access to widgets from secondary thread +typedef TVoidMemFunEvent TCanvasArrayEvent; +typedef TVoidMemFunEvent TCanvasEvent; + +class UpdateEvent : public SALOME_Event +{ + public: + UpdateEvent( QAD_Study* study, bool updSel = true ) : myStudy( study ), myUpdateSel( updSel ) {} + virtual void Execute(){ + if ( myStudy ) myStudy->updateObjBrowser( myUpdateSel ); + } + + private: + QAD_Study* myStudy; + bool myUpdateSel; +}; +// PAL8065: san SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, SUPERV_Graph theDataFlow ) : SUPERVGraph_View(theParent), @@ -275,14 +292,18 @@ void SUPERVGUI_Main::sync() { t += dataflow->Name(); setCaption(t); + + // PAL8065: san + ProcessVoidEvent( new UpdateEvent( study ) ); - study->updateObjBrowser(); if (myCurrentView == CANVASTABLE) { - myArray->sync(); - myArray->update(); + // PAL8065: san + ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::sync ) ); + ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::update ) ); } else { - myCanvas->sync(); - myCanvas->update(); + // PAL8065: san + ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::sync ) ); + ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::update ) ); } } -- 2.30.2