Mercurial > hg > octave-nkf
annotate scripts/plot/util/closereq.m @ 19470:6ca096827123
Use tempname() rather than tmpnam() in core Octave.
* scripts/miscellaneous/tempname.m: Removed m-file as function is now C++.
* scripts/miscellaneous/tmpnam.m: New m-file is an alias that calls tempname.
* scripts/miscellaneous/module.mk: Add tmpnam.m to build system.
* io.txi: Place tempname, tempdir, P_tmpdir docstrings in section on temporary
files.
* system.txi: Remove tempname, tempdir, P_tmpdir docstrings from generic
system functions section of manual.
* dirfns.cc, dlmread.cc, md5sum.cc, ov-fcn-handle.cc: Replace instances
of tmpnam with tempname in BIST code.
* file-io.cc (Ftempname): Change DEFUNX for tmpnam to DEFUN for tempname.
Remove seealso links to tmpnam.
* ftp.m, playaudio.m, wavwrite.m, imformats.m, imread.m, imwrite.m, imageIO.m,
csvwrite.m, dlmwrite.m, fileread.m, importdata.m, textread.m, textscan.m,
genvarname.m, unpack.m, install.m, legend.m, __gnuplot_drawnow__.m,
copyobj.m, hgsave.m, print.m, __ghostscript__.m, __gnuplot_get_var__.m,
__gnuplot_ginput__.m, __gnuplot_print__.m: Replace tmpnam with tempname in
core code.
* build-sparse-tests.sh, io.tst, prefer.tst, system.tst: Replace tmpnam with
tempname in test code.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 22 Oct 2014 10:41:15 -0700 |
parents | d63878346099 |
children | 4197fc428c7d |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17572
diff
changeset
|
1 ## Copyright (C) 2005-2013 John W. Eaton |
6257 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6257 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6257 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} closereq () | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
15466
diff
changeset
|
21 ## Close the current figure and delete all graphics objects associated with it. |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
22 ## |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
23 ## By default, the @qcode{"closerequestfcn"} property of a new plot figure |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
24 ## points to this function. |
6895 | 25 ## @seealso{close, delete} |
6257 | 26 ## @end deftypefn |
27 | |
28 ## Author: jwe | |
29 | |
30 function closereq () | |
31 | |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
32 if (nargin != 0) |
6257 | 33 print_usage (); |
34 endif | |
35 | |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
36 cf = gcbf (); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
37 if (isempty (cf)) |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
38 warning ("closereq: calling closereq from octave prompt is not supported, use 'close' instead"); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
39 cf = get (0, "currentfigure"); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
40 endif |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
41 if (! isempty (cf) && isfigure (cf)) |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
42 delete (cf); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
43 endif |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
44 |
6257 | 45 endfunction |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
46 |