Graphics macros: fix edit_curv 45/18145/2
Paul Bignier [Mon, 9 May 2016 11:48:31 +0000 (13:48 +0200)]
 * Used by LOOKUP_f block.

Change-Id: I7a635e99b99de11439b9321f07b9392ea9e4267a

scilab/modules/graphics/macros/edit_curv.sci

index c4125ba..2dc70eb 100644 (file)
@@ -109,8 +109,13 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
     w="menus(3)(";rpar=")"
     Data=w(ones(menu_d))+string(1:size(menu_d,"*"))+rpar(ones(menu_d))
 
-    curwin = max(winsid())+1;
-    scf(curwin) ;
+    wins = winsid();
+    if ~isempty(wins) then
+        curwin = max(winsid())+1;
+    else
+        curwin = 1;
+    end
+    scf(curwin);
 
     // Disable the menus and toolbars
     toolbar(curwin,"off");