comparison scripts/plot/allchild.m @ 13977:08ae07e40d4f

Only run uimenu tests if FLTK toolkit is available (Bug #34908) * graphics_toolkit.m: Correct @deftypefn to @deftypefnx for Texinfo to build * allchild.m: Eliminate unnecessary for loop. Only run test if FLTK toolkit is available. * findall.m, uimenu.m: Only run test if FLTK toolkit is available.
author Rik <octave@nomad.inbox5.com>
date Fri, 02 Dec 2011 14:48:45 -0800
parents e81ddf9cacd5
children 72c96de7a403
comparison
equal deleted inserted replaced
13976:fb5955171b0b 13977:08ae07e40d4f
33 function h = allchild (handles) 33 function h = allchild (handles)
34 34
35 shh = get (0, "showhiddenhandles"); 35 shh = get (0, "showhiddenhandles");
36 unwind_protect 36 unwind_protect
37 set (0, "showhiddenhandles", "on"); 37 set (0, "showhiddenhandles", "on");
38 if (isscalar (handles)) 38 h = get (handles, "children");
39 h = get (handles, "children");
40 else
41 h = cell (size (handles));
42 for i = 1:numel (handles)
43 h{i} = get (handles, "children");
44 endfor
45 endif
46 unwind_protect_cleanup 39 unwind_protect_cleanup
47 set (0, "showhiddenhandles", shh); 40 set (0, "showhiddenhandles", shh);
48 end_unwind_protect 41 end_unwind_protect
49 42
50 endfunction 43 endfunction
51 44
52 %!test 45
46 %!testif HAVE_FLTK
47 %! toolkit = graphics_toolkit ();
48 %! graphics_toolkit ("fltk");
53 %! hf = figure ("visible", "off"); 49 %! hf = figure ("visible", "off");
54 %! unwind_protect 50 %! unwind_protect
55 %! l = line; 51 %! l = line;
56 %! assert(get(allchild(hf),'type'),{'axes'; 'uimenu'; 'uimenu'; 'uimenu'}) 52 %! assert(get (allchild (hf),"type"),{"axes"; "uimenu"; "uimenu"; "uimenu"});
57 %! unwind_protect_cleanup 53 %! unwind_protect_cleanup
58 %! close (hf); 54 %! close (hf);
55 %! graphics_toolkit (toolkit);
59 %! end_unwind_protect 56 %! end_unwind_protect
57