Mercurial > hg > octave-nkf
annotate scripts/gui/uimenu.m @ 20038:9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Try to trim long lines to < 80 chars.
Use '##' for single line comments.
Use '(...)' around tests for if/elseif/switch/while.
Abut cell indexing operator '{' next to variable.
Abut array indexing operator '(' next to variable.
Use space between negation operator '!' and following expression.
Use two newlines between endfunction and start of %!test or %!demo code.
Remove unnecessary parens grouping between short-circuit operators.
Remove stray extra spaces (typos) between variables and assignment operators.
Remove stray extra spaces from ends of lines.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 23 Feb 2015 14:54:39 -0800 |
parents | 4197fc428c7d |
children | ac59136f1f10 |
rev | line source |
---|---|
19898
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 -*- |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
20 ## @deftypefn {Function File} {@var{hui} =} uimenu (@var{property}, @var{value}, @dots{}) |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
21 ## @deftypefnx {Function File} {@var{hui} =} uimenu (@var{h}, @var{property}, @var{value}, @dots{}) |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
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:
19898
diff
changeset
|
23 ## |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
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:
19898
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 |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
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:
19898
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 | 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 | 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 | 105 |
13977
08ae07e40d4f
Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents:
13703
diff
changeset
|
106 %!testif 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 | 109 %! unwind_protect |
110 %! ui = uimenu ("label", "mylabel"); | |
111 %! assert (findobj (hf, "type", "uimenu"), ui); | |
112 %! assert (get (ui, "label"), "mylabel"); | |
113 %! assert (get (ui, "checked"), "off"); | |
114 %! assert (get (ui, "separator"), "off"); | |
115 %! assert (get (ui, "enable"), "on"); | |
116 %! assert (get (ui, "position"), 9); | |
117 %! unwind_protect_cleanup | |
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 | 120 %! end_unwind_protect |
121 | |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
122 ## check for top level menus file, edit, and help |
13977
08ae07e40d4f
Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents:
13703
diff
changeset
|
123 %!testif 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 | 126 %! unwind_protect |
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 | 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 | 131 %! uih = findall (hf, "label", "&help"); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
132 %! assert (ishghandle (uih)); |
13215 | 133 %! unwind_protect_cleanup |
134 %! close (hf); | |
13977
08ae07e40d4f
Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents:
13703
diff
changeset
|
135 %! graphics_toolkit (toolkit); |
13215 | 136 %! end_unwind_protect |
137 | |
13977
08ae07e40d4f
Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents:
13703
diff
changeset
|
138 %!testif HAVE_FLTK |
17107
dbd64c9a16da
Restore graphics toolkit after %!tests that alter it.
Rik <rik@octave.org>
parents:
14335
diff
changeset
|
139 %! 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
|
140 %! hf = figure ("visible", "off"); |
13215 | 141 %! unwind_protect |
13223 | 142 %! uie = findall (hf, "label", "&edit"); |
13215 | 143 %! 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
|
144 %! assert (ancestor (myui, "uimenu", "toplevel"), uie); |
13215 | 145 %! unwind_protect_cleanup |
146 %! close (hf); | |
13977
08ae07e40d4f
Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents:
13703
diff
changeset
|
147 %! graphics_toolkit (toolkit); |
13215 | 148 %! 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
|
149 |