diff scripts/gui/uiputfile.m @ 18970:bb2a03f9ed20

Fix uigetdir, uigetfile, uiputfile. Remove check for nonexistent return value * uigetfile.m: Don't check for existence of fltk script files. They are always distributed, even when built without FLTK. This function failed after moving the helper functions to ./private. * uigetdir.m, uiputfile: same as uigetfile.m * __is_function__.m: Remove comparison with impossible exist return value.
author Andreas Weber <andy.weber.aw@gmail.com>
date Wed, 30 Jul 2014 23:34:14 +0200
parents d63878346099
children f084aab05cd9
line wrap: on
line diff
--- a/scripts/gui/uiputfile.m	Tue Jul 29 21:13:03 2014 +0200
+++ b/scripts/gui/uiputfile.m	Wed Jul 30 23:34:14 2014 +0200
@@ -57,18 +57,12 @@
 function [retfile, retpath, retindex] = uiputfile (varargin)
 
   if (! __octave_link_enabled__ ())
-    defaulttoolkit = get (0, "defaultfigure__graphics_toolkit__");
-    funcname = ["__uiputfile_", defaulttoolkit, "__"];
-    functype = exist (funcname);
-    if (! __is_function__ (funcname))
-      funcname = "__uiputfile_fltk__";
-      if (! __is_function__ (funcname))
-        error ("uiputfile: fltk graphics toolkit required");
-      elseif (! strcmp (defaulttoolkit, "gnuplot"))
-        warning ("uiputfile: no implementation for toolkit '%s', using 'fltk' instead",
-               defaulttoolkit);
-      endif
+    tk = graphics_toolkit ();
+    funcname = ["uiputfile", tk, "__"];
+    if (numel (tk) > 0 && ! __is_function__ (funcname))
+      warning ("uiputfile: no implementation for toolkit '%s', using 'fltk' instead", tk);
     endif
+    funcname = "__uiputfile_fltk__";
   endif
 
   if (nargin > 3)