annotate scripts/gui/uimenu.m @ 21511:e1c5aca1c798

Fix failing tests when building with --without-opengl * graphics.cc, __osmesa_print__.cc, uimenu.m, allchild.m, findall.m, graphics_toolkit.m: Fix failing BIST tests when building with --without-opengl by adding HAVE_OPENGL to the test preconditions.
author Mike Miller <mtmiller@octave.org>
date Mon, 21 Mar 2016 15:01:12 -0700
parents 516bb87ea72e
children bac0d6f07a3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
1 ## Copyright (C) 2010-2015 Kai Habel
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
2 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
3 ## This file is part of Octave.
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
4 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
8 ## your option) any later version.
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
9 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
13 ## General Public License for more details.
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
14 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
18
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
19 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20056
diff changeset
20 ## @deftypefn {} {@var{hui} =} uimenu (@var{property}, @var{value}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20056
diff changeset
21 ## @deftypefnx {} {@var{hui} =} uimenu (@var{h}, @var{property}, @var{value}, @dots{})
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
22 ## Create a uimenu object and return a handle to it.
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 ##
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
24 ## If @var{h} is omitted then a top-level menu for the current figure is
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
25 ## created. If @var{h} is given then a submenu relative to @var{h} is created.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11563
diff changeset
26 ##
12522
33bbae85769a Add uimenu, uigetdir, uigetfile, and uiputfile to documentation.
Rik <octave@nomad.inbox5.com>
parents: 11595
diff changeset
27 ## uimenu objects have the following specific properties:
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
28 ##
11595
5ec6aa05638d Prevent doubled quotes around @table items in Info.
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
29 ## @table @asis
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
30 ## @item @qcode{"accelerator"}
12522
33bbae85769a Add uimenu, uigetdir, uigetfile, and uiputfile to documentation.
Rik <octave@nomad.inbox5.com>
parents: 11595
diff changeset
31 ## A string containing the key combination together with CTRL to execute this
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
32 ## menu entry (e.g., @qcode{"x"} for CTRL+x).
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
33 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
34 ## @item @qcode{"callback"}
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11563
diff changeset
35 ## Is the function called when this menu entry is executed. It can be either a
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
36 ## function string (e.g., @qcode{"myfun"}), a function handle (e.g., @@myfun)
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
37 ## or a cell array containing the function handle and arguments for the
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
38 ## callback function (e.g., @{@@myfun, arg1, arg2@}).
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
39 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
40 ## @item @qcode{"checked"}
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
41 ## Can be set @qcode{"on"} or @qcode{"off"}. Sets a mark at this menu entry.
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
42 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
43 ## @item @qcode{"enable"}
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
44 ## Can be set @qcode{"on"} or @qcode{"off"}. If disabled the menu entry
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
45 ## cannot be selected and it is grayed out.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11563
diff changeset
46 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
47 ## @item @qcode{"foregroundcolor"}
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
48 ## A color value setting the text color for this menu entry.
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
49 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
50 ## @item @qcode{"label"}
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
51 ## A string containing the label for this menu entry. A @qcode{"&"}-symbol
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
52 ## can be used to mark the @qcode{"accelerator"} character (e.g.,
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
53 ## @nospell{@qcode{"E&xit"}})
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
54 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
55 ## @item @qcode{"position"}
11563
3c6e8aaa9555 Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
56 ## An scalar value containing the relative menu position. The entry with the
3c6e8aaa9555 Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
57 ## lowest value is at the first position starting from left or top.
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
58 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
59 ## @item @qcode{"separator"}
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
60 ## Can be set @qcode{"on"} or @qcode{"off"}. If enabled it draws a separator
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17119
diff changeset
61 ## line above the current position. It is ignored for top level entries.
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
62 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
63 ## @end table
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
64 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
65 ## Examples:
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
66 ##
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
67 ## @example
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
68 ## @group
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
69 ## f = uimenu ("label", "&File", "accelerator", "f");
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
70 ## e = uimenu ("label", "&Edit", "accelerator", "e");
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
71 ## uimenu (f, "label", "Close", "accelerator", "q", ...
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
72 ## "callback", "close (gcf)");
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
73 ## uimenu (e, "label", "Toggle &Grid", "accelerator", "g", ...
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
74 ## "callback", "grid (gca)");
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
75 ## @end group
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
76 ## @end example
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
77 ## @seealso{figure}
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
78 ## @end deftypefn
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
79
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
80 ## Author: Kai Habel
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
81
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
82 function hui = uimenu (varargin)
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
83
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
84 [h, args] = __uiobject_split_args__ ("uimenu", varargin,
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
85 {"figure", "uicontextmenu", "uimenu"});
11295
75ff3db6a687 Simplify code for uimenu.m. Fix error messages for ui file functions.
Kai Habel <kai.habel@gmx.de>
parents: 11159
diff changeset
86
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
87 tmp = __go_uimenu__ (h, args{:});
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
88
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
89 if (nargout > 0)
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
90 hui = tmp;
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
91 endif
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
92
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
93 endfunction
11159
a06759adaa79 Add demo for uimenu.m
Kai Habel <kai.habel@gmx.de>
parents: 11155
diff changeset
94
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
95
11159
a06759adaa79 Add demo for uimenu.m
Kai Habel <kai.habel@gmx.de>
parents: 11155
diff changeset
96 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
97 %! clf;
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
98 %! surfl (peaks);
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
99 %! colormap (copper (64));
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
100 %! shading ('interp');
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
101 %! f = uimenu ('label', '&File', 'accelerator', 'f');
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
102 %! e = uimenu ('label', '&Edit', 'accelerator', 'e');
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
103 %! uimenu (f, 'label', 'Close', 'accelerator', 'q', 'callback', 'close (gcf)');
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
104 %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)');
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
105
21511
e1c5aca1c798 Fix failing tests when building with --without-opengl
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
106 %!testif HAVE_OPENGL, HAVE_FLTK
17107
dbd64c9a16da Restore graphics toolkit after %!tests that alter it.
Rik <rik@octave.org>
parents: 14335
diff changeset
107 %! toolkit = graphics_toolkit ("fltk");
17119
bd50e0660545 test: Add missing semicolons to suppress output in some plot %!tests.
Rik <rik@octave.org>
parents: 17107
diff changeset
108 %! hf = figure ("visible", "off");
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
109 %! unwind_protect
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
110 %! ui = uimenu ("label", "mylabel");
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
111 %! assert (findobj (hf, "type", "uimenu"), ui);
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
112 %! assert (get (ui, "label"), "mylabel");
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
113 %! assert (get (ui, "checked"), "off");
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
114 %! assert (get (ui, "separator"), "off");
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
115 %! assert (get (ui, "enable"), "on");
20053
ac59136f1f10 update fltk uimenu position when adding to figure
John Donoghue <john.donoghue@ieee.org>
parents: 19833
diff changeset
116 %! assert (get (ui, "position"), 0);
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
117 %! unwind_protect_cleanup
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
118 %! close (hf);
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
119 %! graphics_toolkit (toolkit);
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
120 %! end_unwind_protect
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
121
20056
df3244834a50 fix tests now that assert ([]) fails
John W. Eaton <jwe@octave.org>
parents: 20053
diff changeset
122 ## check for top level menus file and edit
21511
e1c5aca1c798 Fix failing tests when building with --without-opengl
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
123 %!testif HAVE_OPENGL, HAVE_FLTK
17107
dbd64c9a16da Restore graphics toolkit after %!tests that alter it.
Rik <rik@octave.org>
parents: 14335
diff changeset
124 %! toolkit = graphics_toolkit ("fltk");
17119
bd50e0660545 test: Add missing semicolons to suppress output in some plot %!tests.
Rik <rik@octave.org>
parents: 17107
diff changeset
125 %! hf = figure ("visible", "off");
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
126 %! unwind_protect
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
127 %! uif = findall (hf, "label", "&file");
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
128 %! assert (ishghandle (uif));
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
129 %! uie = findall (hf, "label", "&edit");
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
130 %! assert (ishghandle (uie));
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
131 %! unwind_protect_cleanup
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
132 %! close (hf);
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
133 %! graphics_toolkit (toolkit);
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
134 %! end_unwind_protect
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
135
21511
e1c5aca1c798 Fix failing tests when building with --without-opengl
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
136 %!testif HAVE_OPENGL, HAVE_FLTK
17107
dbd64c9a16da Restore graphics toolkit after %!tests that alter it.
Rik <rik@octave.org>
parents: 14335
diff changeset
137 %! toolkit = graphics_toolkit ("fltk");
17119
bd50e0660545 test: Add missing semicolons to suppress output in some plot %!tests.
Rik <rik@octave.org>
parents: 17107
diff changeset
138 %! hf = figure ("visible", "off");
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
139 %! unwind_protect
13223
931d4b7dc205 avoid output in test
John W. Eaton <jwe@octave.org>
parents: 13215
diff changeset
140 %! uie = findall (hf, "label", "&edit");
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
141 %! myui = uimenu (uie, "label", "mylabel");
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
142 %! assert (ancestor (myui, "uimenu", "toplevel"), uie);
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
143 %! unwind_protect_cleanup
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
144 %! close (hf);
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
145 %! graphics_toolkit (toolkit);
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12974
diff changeset
146 %! end_unwind_protect
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13703
diff changeset
147