Mercurial > hg > octave-nkf
annotate scripts/plot/gcbo.m @ 15137:16a6b0a6855d gui
GUI: support for octave arguments and integrate with run-octave.
* src/octave.h (octave_initialize_interpreter, octave_execute_interpreter):
New functions.
(octave_cmdline_argc, octave_cmdline_argv, octave_embedded): New variables.
* src/octave.cc (octave_cmdline_argc, octave_cmdline_argv, octave_embedded):
New variables.
(octave_initialize_interpreter, octave_execute_interpreter): New functions.
(octave_main): Rewrite using them.
* run-octave.in (octave_executable): New variable.
(-gui): New option flag.
* gui/src/octave-adapter/octave-main-thread.cc (octave_main_thread::run):
Use octave_execute_interpreter.
* gui/src/octave-gui.cc (dissociate_terminal): New function.
(main): Use it. Also use octave_initialize_interpreter.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 05 Aug 2012 16:15:58 -0400 |
parents | f3d52523cde1 |
children | 772f51539af8 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13123
diff
changeset
|
1 ## Copyright (C) 2008-2012 Michael Goffioul |
7935 | 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 -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
9245
diff
changeset
|
20 ## @deftypefn {Function File} {@var{h} =} gcbo () |
7935 | 21 ## @deftypefnx {Function File} {[@var{h}, @var{fig}] =} gcbo () |
22 ## Return a handle to the object whose callback is currently | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
7935
diff
changeset
|
23 ## executing. If no callback is executing, this function returns the |
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
7935
diff
changeset
|
24 ## empty matrix. This handle is obtained from the root object property |
7935 | 25 ## "CallbackObject". |
26 ## | |
27 ## Additionally return the handle of the figure containing the | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
7935
diff
changeset
|
28 ## object whose callback is currently executing. If no callback is |
7935 | 29 ## executing, the second output is also set to the empty matrix. |
30 ## | |
31 ##@seealso{gcf, gca, gcbf} | |
32 ##@end deftypefn | |
33 | |
34 function [h, fig] = gcbo () | |
35 | |
36 h = get (0, "callbackobject"); | |
37 fig = []; | |
38 | |
39 if (! isempty (h) && nargout > 1) | |
40 fig = ancestor (h, "figure"); | |
41 endif | |
42 | |
43 endfunction | |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
44 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
45 |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
46 %!test |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
47 %! assert (isempty (gcbo)); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
48 |