changeset 27103:3aa37c2e22a3

Use crosshair pointer during ginput and gtext execution. * ginput.m: Set current figure pointer to "crosshair". Group successive calls to "set" in one call for efficiency.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 22 May 2019 22:34:38 +0200
parents 84ff9953faa1
children 378cc889fcb6
files scripts/plot/util/ginput.m
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/ginput.m	Wed May 22 13:57:30 2019 +0000
+++ b/scripts/plot/util/ginput.m	Wed May 22 22:34:38 2019 +0200
@@ -72,14 +72,14 @@
   orig_keypressfcn = get (fig, "keypressfcn");
   orig_closerequestfcn = get (fig, "closerequestfcn");
   orig_mousemode = get (fig, "__mouse_mode__");
+  orig_pointer = get (fig, "pointer");
 
   unwind_protect
 
-    set (fig, "windowbuttondownfcn", @ginput_windowbuttondownfcn);
-    set (fig, "keypressfcn", @ginput_keypressfcn);
-    set (fig, "closerequestfcn", {@ginput_closerequestfcn,
-                                  orig_closerequestfcn});
-    set (fig, "__mouse_mode__", "none");
+    set (fig, "windowbuttondownfcn", @ginput_windowbuttondownfcn, ...
+         "keypressfcn", @ginput_keypressfcn, ...
+         "closerequestfcn", {@ginput_closerequestfcn, orig_closerequestfcn}, ...
+         "pointer", "crosshair", "__mouse_mode__", "none");
 
     do
       if (strcmp (toolkit, "fltk"))
@@ -102,10 +102,10 @@
   unwind_protect_cleanup
     if (isfigure (fig))
       ## Only execute if window still exists
-      set (fig, "windowbuttondownfcn", orig_windowbuttondownfcn);
-      set (fig, "keypressfcn", orig_keypressfcn);
-      set (fig, "closerequestfcn", orig_closerequestfcn);
-      set (fig, "__mouse_mode__", orig_mousemode);
+      set (fig, "windowbuttondownfcn", orig_windowbuttondownfcn, ...
+           "keypressfcn", orig_keypressfcn, ...
+           "closerequestfcn", orig_closerequestfcn, ...
+           "pointer", orig_pointer, "__mouse_mode__", orig_mousemode);
     endif
   end_unwind_protect