Bug Fix #13966 - twinkle, twinkle(n) now supported 59/17959/3
Nicolas [Wed, 23 Mar 2016 12:41:48 +0000 (13:41 +0100)]
Change-Id: I3200cb9267c1fe34fb9301febd08dfb41d73702b

scilab/CHANGES
scilab/modules/graphics/help/en_US/twinkle.xml
scilab/modules/graphics/help/fr_FR/twinkle.xml [new file with mode: 0644]
scilab/modules/graphics/help/ja_JP/twinkle.xml
scilab/modules/graphics/help/pt_BR/twinkle.xml
scilab/modules/graphics/help/ru_RU/twinkle.xml
scilab/modules/graphics/macros/twinkle.sci
scilab/modules/graphics/tests/nonreg_tests/bug_13966.dia.ref [new file with mode: 0644]
scilab/modules/graphics/tests/nonreg_tests/bug_13966.tst [new file with mode: 0644]

index 83a03f6..f03301c 100644 (file)
@@ -103,6 +103,8 @@ Other feature additions
 
 * isoview, isoview on, isoview off, isoview(idGraphics, "on"|"off") are now supported
 
+* twinkle and twinkle(n) are now supported: by default, the current element gce() blinks.
+
 * householder() can now return the reflection matrix, and has a demo.
 
 * ndgrid() can now works with any types of homogeneous data
@@ -333,6 +335,8 @@ In 6.0.0:
 
 * Bug #13965 fixed - The rendering of histograms with histplot() was poor
 
+* Bug #13966 fixed - twinkle and twinkle(n) were not supported
+
 * Bug #13974 fixed - isoview(xmin, xmax, ymin, ymax) was unhandy.
 
 * Bug #14035 fixed - ndgrid did not manage all homogeneous data type (booleans, integers, polynomials, rationals, strings, [])
index f826cda..64ad9a6 100644 (file)
@@ -2,7 +2,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
- * 
+ * Copyright (C) 2015 - 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="twinkle">
     <refnamediv>
         <refname>twinkle</refname>
-        <refpurpose>is used to have a graphics entity twinkle</refpurpose>
+        <refpurpose>is used to have a graphics entity blinking</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>twinkle(h,[n])</synopsis>
+        <synopsis>twinkle
+twinkle(n)
+twinkle(h)
+twinkle(h,n)
+        </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    <refsection role="arguments">
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
                 <term>h</term>
                 <listitem>
-                    <para>a handle of a graphics entity.</para>
+                    <para>handle of the unique graphics entity to blink. By default, the current graphic entity handled with <literal>gce()</literal> is considered.</para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>n</term>
                 <listitem>
-                    <para>an integer.</para>
+                    <para>positive integer number: the number of blinks. Default n = 5.</para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Description</title>
         <para>
-            <function>twinkle</function> let the graphics entity given by its handle <varname>h</varname> twinkle. It can be used to
-            find the graphics object corresponding to a graphics handle in the graphics window. By default the graphics
-            entity twinkles 5 times, but you can change this by using optional argument <varname>n</varname>.
+            <function>twinkle</function> blinks <varname>n</varname> times the graphical entity
+            handled with <varname>h</varname>. If <function>twinkle()</function> is run while no
+            graphical figure exists, it does nothing and returns. If the handle <varname>h</varname>
+            is invalid (the entity has been deleted in the meantime),
+            <function>twinkle(h..)</function> yields an error.
         </para>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-x=linspace(-2*%pi,2*%pi,100)';
+        <programlisting role="example"><![CDATA[
+clf
+plot()
+twinkle     // twinkles the last group of curves plotted in the plot() example
+twinkle(3)  // twinkles it only three times
+
+clf
+x = linspace(-2*%pi,2*%pi,100)';
 plot2d(x,[sin(x),cos(x)]);
-e=gce();
-p1=e.children(1);
-p2=e.children(2);
-// cos plot twinkle
-twinkle(p1)
-// sin plot twinkle 10 times
-twinkle(p2,10)
-// axes twinkle
-twinkle(gca())
+e = gce();
+p1 = e.children(1);
+p2 = e.children(2);
+twinkle(p1)       // cos plot twinkle
+twinkle(p2,10)    // sin plot twinkle 10 times
+twinkle(gca())    // axes twinkle
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -71,4 +80,15 @@ twinkle(gca())
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0</revnumber>
+                <revdescription>
+                    <para>twinkle() and twinkle(n) added.</para>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
diff --git a/scilab/modules/graphics/help/fr_FR/twinkle.xml b/scilab/modules/graphics/help/fr_FR/twinkle.xml
new file mode 100644 (file)
index 0000000..425a4b4
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA
+ * Copyright (C) 2015 - 2016 - Samuel GOUGEON
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="fr" xml:id="twinkle">
+    <refnamediv>
+        <refname>twinkle</refname>
+        <refpurpose>fait clignoter un élément graphique pour le repérer visuellement</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntaxe</title>
+        <synopsis>twinkle
+twinkle(n)
+twinkle(h)
+twinkle(h,n)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection role="arguments">
+        <title>Paramètres</title>
+        <variablelist>
+            <varlistentry>
+                <term>h</term>
+                <listitem>
+                    <para>identifiant de l'élément graphique à repérer. Par défaut, l'élément
+                      graphique actif d'identifiant <literal>gce()</literal> est considéré.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>n</term>
+                <listitem>
+                    <para>nombre de clignotements. Par défaut, n=5</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection role="description">
+        <title>Description</title>
+        <para>
+            <function>twinkle</function> fait clignoter <varname>n</varname> fois l'élément graphique
+            dont l'identifiant graphique <varname>h</varname> est spécifié.
+            Si <function>twinkle()</function> est appelé sans paramètre alors qu'aucune fenêtre
+            graphique n'existe, l'instruction est ignorée. Si l'identifiant graphique
+            <varname>h</varname> est invalide (l'élément graphique correspondant a été supprimé
+            entretemps), <function>twinkle(h..)</function> produit une erreur.
+        </para>
+    </refsection>
+    <refsection role="examples">
+        <title>Exemples</title>
+        <programlisting role="example"><![CDATA[
+clf
+plot()
+twinkle    // fait clignoter le dernier groupe de courbes dessinées dans l'exemple de plot()
+twinkle(3) // le fait clignoter seulement 3 fois
+
+clf
+x = linspace(-2*%pi,2*%pi,100)';
+plot2d(x,[sin(x),cos(x)]);
+e = gce();
+p1 = e.children(1);
+p2 = e.children(2);
+twinkle(p1)     // Courbe du cosinus
+twinkle(p2,10)  // Courbe du sinus, 10 fois
+twinkle(gca())  // Repère actif entier
+]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>Voir aussi</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="graphics_entities">Eléments graphiques</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0</revnumber>
+                <revdescription>
+                    <para>twinkle() et twinkle(n) ajoutés.</para>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index 3d37495..3e75d04 100644 (file)
@@ -1,14 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
-
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-
  * Copyright (C) INRIA
-
- * 
-
-
+ * Copyright (C) 2015 - 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * and continues to be available under such terms.
  * For more information, see the COPYING file which you should have received
  * along with this program.
-
  *
-
  -->
-
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="twinkle">
-    
     <refnamediv>
-        
         <refname>twinkle</refname>
-        
         <refpurpose>グラフィックエンティティを点滅させる</refpurpose>
-        
     </refnamediv>
-    
     <refsynopsisdiv>
-        
         <title>呼び出し手順</title>
-        
-        <synopsis>twinkle(h,[n])</synopsis>
-        
+        <synopsis>twinkle
+twinkle(n)
+twinkle(h)
+twinkle(h,n)
+        </synopsis>
     </refsynopsisdiv>
-    
-    <refsection>
-        
+    <refsection role="arguments">
         <title>Parameters</title>
-        
         <variablelist>
-            
             <varlistentry>
-                
                 <term>h</term>
-                
                 <listitem>
-                    
-                    <para>グラフィックエンティティのハンドル.</para>
-                    
+                    <para>グラフィックエンティティのハンドル. By default, the current graphic entity
+                      handled with <literal>gce()</literal> is considered.
+                    </para>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>n</term>
-                
                 <listitem>
-                    
                     <para>整数.</para>
-                    
                 </listitem>
-                
             </varlistentry>
-            
         </variablelist>
-        
     </refsection>
-    
-    <refsection>
-        
+    <refsection role="description">
         <title>説明n</title>
-        
         <para>
-            
             <literal>twinkle</literal>はハンドル<literal>h</literal> で
-            
             指定したグラフィックエンティティを点滅させます.
-            
             グラフィックウインドウ内でグラフィックハンドルに対応するグラフィックオブジェクトを
-            
             探す際に使用することができます.
-            
             デフォルトでグラフィックエンティティは5回点滅しますが,
-            
             オプションの引数 <literal>n</literal>によりこの値を変更することができます.
-            
         </para>
-        
     </refsection>
-    
-    <refsection>
-        
+    <refsection role="examples">
         <title>例</title>
-        
-        <programlisting role="example"><![CDATA[ 
-
-x=linspace(-2*%pi,2*%pi,100)';
-
+        <programlisting role="example"><![CDATA[
+clf
+plot()
+twinkle     // twinkles the last group of curves plotted in the plot() example
+twinkle(3)  // twinkles it only three times
+
+clf
+x = linspace(-2*%pi,2*%pi,100)';
 plot2d(x,[sin(x),cos(x)]);
+e = gce();
+p1 = e.children(1);
+p2 = e.children(2);
 
-e=gce(); p1=e.children(1); p2=e.children(2);
-
-// cos plot twinkle
-
-twinkle(p1)
-
-// sin plot twinkle 10 回
-
-twinkle(p2,10)
-
-// axes twinkle
-
-twinkle(gca())
-
+twinkle(p1)    // cos plot twinkle
+twinkle(p2,10) // sin plot twinkles 10 times
+twinkle(gca()) // axes twinkle
  ]]></programlisting>
-        
     </refsection>
-    
     <refsection role="see also">
-        
         <title>参照</title>
-        
         <simplelist type="inline">
-            
             <member>
-                
                 <link linkend="graphics_entities">graphics_entities</link>
-                
             </member>
-            
         </simplelist>
-        
     </refsection>
-    
-</refentry>
-
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0</revnumber>
+                <revdescription>
+                    <para>twinkle() and twinkle(n) added.</para>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index 4d01524..59892c2 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
- * 
+ * Copyright (C) 2015 - 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="twinkle" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="twinkle" xml:lang="pt">
     <refnamediv>
         <refname>twinkle</refname>
-        <refpurpose>Faz uma entidade gráfica piscar</refpurpose>
+        <refpurpose>Faz uma entidade gráfica piscar</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>twinkle(h,[n])</synopsis>
+        <title>Seqüência de Chamamento</title>
+        <synopsis>twinkle
+twinkle(n)
+twinkle(h)
+twinkle(h,n)
+        </synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
+    <refsection role="arguments">
+        <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
                 <term>h</term>
                 <listitem>
-                    <para>manipulador de uma entidade gráfica </para>
+                    <para>manipulador de uma entidade gráfica. By default, the current graphic
+                      entity handled with <literal>gce()</literal> is considered.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
-        <title>Descrição</title>
+    <refsection role="description">
+        <title>Descrição</title>
         <para>
-            <literal>twinkle</literal> faz com que a entidade gráfica dada pelo
-            seu manipulador h pisque. Pode ser usado para encontrar o objeto gráfico
-            correspondente a um manipulador gráfico em uma janela de gráficos. Por
-            padrão, a entidade gráfica pisca 5 vezes, mas você pode mudar este número
-            através do argumento opcional <literal>n</literal>.
+            <literal>twinkle</literal> faz com que a entidade gráfica dada pelo
+            seu manipulador h pisque. Pode ser usado para encontrar o objeto gráfico
+            correspondente a um manipulador gráfico em uma janela de gráficos. Por
+            padrão, a entidade gráfica pisca 5 vezes, mas você pode mudar este número
+            através do argumento opcional <literal>n</literal>.
         </para>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[ 
-x=linspace(-2*%pi,2*%pi,100)';
+        <programlisting role="example"><![CDATA[
+clf
+plot()
+twinkle     // twinkles the last group of curves plotted in the plot() example
+twinkle(3)  // twinkles it only three times
+
+clf
+x = linspace(-2*%pi,2*%pi,100)';
 plot2d(x,[sin(x),cos(x)]);
-e=gce(); p1=e.children(1); p2=e.children(2);
-// fazendo piscar o esboço de cos
-twinkle(p1)
-// fazendo piscar o esboço de sin piscar
-twinkle(p2,10)
-// eixos piscando
-twinkle(gca())
+e = gce();
+p1 = e.children(1);
+p2 = e.children(2);
+twinkle(p1)     // fazendo piscar o esboço de cos
+twinkle(p2,10)  // fazendo piscar o esboço de sin piscar
+twinkle(gca())  // eixos piscando
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
-        <title>Ver Também</title>
+        <title>Ver Também</title>
         <simplelist type="inline">
             <member>
                 <link linkend="graphics_entities">graphics_entities</link>
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0</revnumber>
+                <revdescription>
+                    <para>twinkle() and twinkle(n) added.</para>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index cd4c100..8c4fee5 100644 (file)
@@ -2,7 +2,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
- * 
+ * Copyright (C) 2015 - 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
     </refnamediv>
     <refsynopsisdiv>
         <title>Последовательность вызова</title>
-        <synopsis>twinkle(h,[n])</synopsis>
+        <synopsis>twinkle
+twinkle(n)
+twinkle(h)
+twinkle(h,n)
+        </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    <refsection role="arguments">
         <title>Аргументы</title>
         <variablelist>
             <varlistentry>
                 <term>h</term>
                 <listitem>
-                    <para>указатель на графический объект.</para>
+                    <para>указатель на графический объект. By default, the current graphic entity
+                      handled with <literal>gce()</literal> is considered.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
@@ -39,7 +45,7 @@
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Описание</title>
         <para>
             Функция <function>twinkle</function> заставляет графический объект,
             <varname>n</varname>.
         </para>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Примеры</title>
-        <programlisting role="example"><![CDATA[ 
-x=linspace(-2*%pi,2*%pi,100)';
+        <programlisting role="example"><![CDATA[
+clf
+plot()
+twinkle     // twinkles the last group of curves plotted in the plot() example
+twinkle(3)  // twinkles it only three times
+
+x = linspace(-2*%pi,2*%pi,100)';
 plot2d(x,[sin(x),cos(x)]);
-e=gce();
-p1=e.children(1);
-p2=e.children(2);
-// мерцает график косинуса
-twinkle(p1)
-// график синуса мерцает 10 раз
-twinkle(p2,10)
-// мерцают оси
-twinkle(gca())
+e = gce();
+p1 = e.children(1);
+p2 = e.children(2);
+twinkle(p1)     // мерцает график косинуса
+twinkle(p2,10)  // график синуса мерцает 10 раз
+twinkle(gca())  // мерцают оси
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -74,4 +82,15 @@ twinkle(gca())
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0</revnumber>
+                <revdescription>
+                    <para>twinkle() and twinkle(n) added.</para>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index b57e9c2..a5d8694 100644 (file)
@@ -1,5 +1,6 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) INRIA
+// Copyright (C) 2015 - 2016 - Samuel GOUGEON
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
 //
 // This file is hereby licensed under the terms of the GNU GPL v2.0,
 
 function twinkle(h,n)
 
+    // CHECKING INPUT ARGUMENTS
     [lhs,rhs]=argn(0)
-    if rhs==1 then
-        if (type(h)<>9 | size(h,"*")<>1) then
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Graphic handle expected.\n"), "twinkle", 1));
-        end
-        n=5;
-    elseif rhs==2 then
-        if (type(h)<>9 | size(h,"*")<>1) then
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Graphic handle expected.\n"), "twinkle", 1));
+    if rhs==0 then
+        if winsid()~=[] then
+            h = gce()
+            n = 5
+        else
+            return
         end
-        if (type(n)<>1 | size(n,"*")<>1) then
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"), "twinkle", 2));
+    end
+    if rhs==1 then
+        if type(h)<>9
+            n = h
+            if winsid()~=[]
+                h = gce()
+            else
+                return
+            end
+        else
+            h = h(1)
+            n = 5
         end
-    else
-        error(msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "twinkle", 1, 2));
+    end
+    if type(h)<>9 then
+        msg = _("%s: Wrong type for input argument #%d: Graphic handle expected.\n")
+        error(msprintf(msg, "twinkle", 1));
+    end
+    if type(n)<>1 | n<0 then
+        msg = _("%s: Wrong type for input argument #%d: Positive integer expected.\n")
+        error(msprintf(msg, "twinkle", min(rhs,2)));
     end
 
-    f=h;
+    // BLINKING THE GRAPHICAL COMPONENT
+    f = h;
     while f.type<>"Figure"
-        f=f.parent;
+        f = f.parent;
     end
     realtimeinit(0.2);
     realtime(0);
-    k=0;
+    k = 0;
 
-    v=h.visible;
-    for i=1:n
-        k=k+2;
-        h.visible="off";
+    v = h.visible;
+    for i = 1:n
+        k = k+2;
+        h.visible = "off";
         realtime(k);
-        h.visible="on";
+        h.visible = "on";
         realtime(k+1);
     end
-    h.visible=v;
-
+    h.visible = v;
 endfunction
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_13966.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_13966.dia.ref
new file mode 100644 (file)
index 0000000..d2f838b
--- /dev/null
@@ -0,0 +1,21 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2016 - Samuel GOUGEON
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH GRAPHIC -->
+// <-- Non-regression test for bug 13966 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/13966
+//
+// <-- Short Description -->
+// twinkle() and twinkle(n) were not available
+close(winsid());
+twinkle();
+twinkle(2);
+plot2d(1:10);
+twinkle();
+twinkle(2);
+close(gcf());
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_13966.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_13966.tst
new file mode 100644 (file)
index 0000000..d2f838b
--- /dev/null
@@ -0,0 +1,21 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2016 - Samuel GOUGEON
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH GRAPHIC -->
+// <-- Non-regression test for bug 13966 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/13966
+//
+// <-- Short Description -->
+// twinkle() and twinkle(n) were not available
+close(winsid());
+twinkle();
+twinkle(2);
+plot2d(1:10);
+twinkle();
+twinkle(2);
+close(gcf());