Sigbuilder block was opening two figures when asked to launch graphic window
[scilab.git] / scilab / modules / scicos_blocks / macros / Sources / CURVE_c.sci
index 3f09d19..703951a 100644 (file)
@@ -93,16 +93,13 @@ select job
        ipar=[N;mtd;PO];
        rpar=[];
 
-        if ~exists('curwin') then
-         gh = gcf();
-         curwin = gh.figure_id
-        end
-
-        save_curwin = curwin;
-        curwin = max(winsid())+1; //** prepare a brand new win 
-         //** see below in this file; "poke_point" is very similar to "edit_curv"
-        [orpar,oipar,ok] = poke_point(xy,ipar,rpar); //** HERE WE ARE +++++++++++++++++++++++++++++++++++  
-       curwin = save_curwin;
+       if (winsid() == []) then
+         curwin = 0;
+       else
+         curwin = max(winsid())+1; //** prepare a brand new win
+       end
+       //** see below in this file; "poke_point" is very similar to "edit_curv"
+       [orpar,oipar,ok] = poke_point(xy,ipar,rpar); //** HERE WE ARE +++++++++++++++++++++++++++++++++++
        if ~ok then break;end;//  exit without save
 
        // verifying the data change