changeset 11194:b8585f8e11d5

__fltk_ginput__.m: Use semicolons to prevent internal function evaluations being output to screen.
author Rik <octave@nomad.inbox5.com>
date Thu, 04 Nov 2010 13:34:58 -0700
parents 364ef2eb2499
children 8f67fe9dd64e
files scripts/ChangeLog scripts/plot/__fltk_ginput__.m
diffstat 2 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu Nov 04 12:47:19 2010 -0700
+++ b/scripts/ChangeLog	Thu Nov 04 13:34:58 2010 -0700
@@ -1,3 +1,8 @@
+2010-11-04  Rik  <octave@nomad.inbox5.com>
+
+	* plot/__fltk_ginput__.m: Use semicolons to prevent internal
+	  function evaluations being output to screen.
+
 2010-11-04  Rik  <octave@nomad.inbox5.com>
 
 	* plot/module.mk: Add __fltk_ginput__.m to list of scripts
--- a/scripts/plot/__fltk_ginput__.m	Thu Nov 04 12:47:19 2010 -0700
+++ b/scripts/plot/__fltk_ginput__.m	Thu Nov 04 13:34:58 2010 -0700
@@ -29,9 +29,7 @@
     error ("ginput: must have at least one axes");
   endif
 
-  x = [];
-  y = [];
-  button = [];
+  x = y = button = [];
   ginput_aggregator (0, 0, 0);
 
   unwind_protect
@@ -64,18 +62,18 @@
 endfunction
 
 function [x, y, n] = ginput_aggregator (mode , xn, yn)
-  persistent x y n
+  persistent x y n;
 
-  if (mode == 0),
+  if (mode == 0)
     x = [];
     y = [];
     n = 0;
   elseif (mode == 1)
-    x = [x, xn];
-    y = [y, yn];
+    x = [x; xn];
+    y = [y; yn];
     n += 1;
   elseif (mode == 2)
-    n = -1
+    n = -1;
   endif
 endfunction
 
@@ -85,8 +83,8 @@
 endfunction
 
 function ginput_keypressfcn (src, evt)
-  if (evt.Key == 10)
-    ginput_aggregator (2, 0, 0)
+  if (evt.Key == 10)    # linefeed character
+    ginput_aggregator (2, 0, 0);
   endif
 endfunction