Mercurial > hg > octave-lyh
annotate scripts/plot/gnuplot_binary.in @ 14014:907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
* graphics.cc (Fdrawnow): Don't register __go_close_all__ as an atexit
function.
* __go_close_all__.m: Delete.
* plot/module.mk (plot_FCN_FILES): Remove __go_close_all__.m from the
list.
* graphics.cc (gh_manager::create_instance): Do register cleanup
function.
* graphics.cc (delete_graphics_objects, delete_graphics_object,
close_figure, force_close_figure): New functions.
(F__go_delete__): Call delete_graphics_objects to do the work.
* graphics.h, graphics.cc (gh_manager::close_all_figures,
gh_manager::do_close_all_figures): New functions.
* graphics.h.in, graphics.cc (close_all_figures): New function.
* toplev.cc (clean_up_and_exit): Call close_all_figures.
* graphics.h.in (uitoggletool::~uitoggletool, uipushtool::~uipushtool,
uitoolbar::~uitoolbar, uipanel::~uipanel, uicontrol::~uicontrol,
uicontextmenu::~uicontextmenu, uimenu::~uimenu, hggroup::~hggroup,
surface::~surface, image::~image, text::~text, line::~line,
axes::~axes, figure::~figure, root_figure::~root_figure):
Don't delete children.
* toplev.cc (SAFE_CALL, IGNORE_INTERRUPT): Rename to OCTAVE_SAFE_CALL
and OCTAVE_IGNORE_INTERRUPT and move to toplev.h. Temporarily set
Vdebug_on_error and Vdebug_on_warning. Reset error_state to zero.
Change all callers.
* graphics.h.in (base_graphics_toolkit::close): New virtual function.
(graphics_toolkit::close, graphics_toolkit::close_all_toolkits):
New functions.
* graphics.cc (gnuplot_toolkit::close): New function.
):
* __init_fltk__.cc (F__init_fltk__): Don't register __remove_fltk__ as
an atexit function.
(F__remove_fltk__): Move to fltk_toolkit::close.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 08 Dec 2011 06:28:18 -0500 |
parents | 4ae2a74ed04c |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2008-2011 John W. Eaton |
7361 | 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 | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
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 | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
20 ## @deftypefn {Loadable Function} {[@var{prog}, @var{args}] =} gnuplot_binary () |
9467
49f890499ebc
fix typo in gnuplot_binary
Jaroslav Hajek <highegg@gmail.com>
parents:
9461
diff
changeset
|
21 ## @deftypefnx {Loadable Function} {[@var{old_prog}, @var{old_args}] =} gnuplot_binary (@var{new_prog}, @var{arg1}, @dots{}) |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
22 ## Query or set the name of the program invoked by the plot command |
12215
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
23 ## when the graphics toolkit is set to "gnuplot". Additional arguments to |
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
24 ## pass to the external plotting program may also be given. |
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
25 ## The default value is @code{"gnuplot"} without additional arguments. |
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
26 ## @xref{Installation}. |
7361 | 27 ## @end deftypefn |
28 | |
29 ## Author: jwe | |
30 | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
31 function [prog, args] = gnuplot_binary (new_prog, varargin) |
7361 | 32 |
33 persistent gp_binary = %OCTAVE_CONF_GNUPLOT%; | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
34 persistent gp_args = {}; |
7361 | 35 |
36 if (nargout > 0 || nargin == 0) | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
37 prog = gp_binary; |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
38 args = gp_args; |
7361 | 39 endif |
40 | |
41 if (nargin == 1) | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
42 if (ischar (new_prog)) |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
43 if (! isempty (new_prog)) |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
44 gp_binary = new_prog; |
7361 | 45 else |
46 error ("gnuplot_binary: value must not be empty"); | |
47 endif | |
48 else | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
49 error ("gnuplot_binary: expecting program to be a character string"); |
7361 | 50 endif |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
51 endif |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
52 |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
53 if (nargin > 1) |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
54 if (iscellstr (varargin)) |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
55 gp_args = varargin; |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
56 else |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
57 error ("gnuplot_binary: expecting arguments to be character strings"); |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
58 endif |
7361 | 59 endif |
60 | |
61 endfunction |