# HG changeset patch # User Rik # Date 1375125790 25200 # Node ID dbd64c9a16da6584b3da3d84bb3f11517c51f3d9 # Parent 054905bfc306a600c4e136ca677d987c761a69c0 Restore graphics toolkit after %!tests that alter it. * scripts/plot/allchild.m, scripts/plot/findall.m, scripts/plot/findobj.m, scripts/plot/graphics_toolkit.m, scripts/plot/legend.m, scripts/plot/uimenu.m: Restore graphics toolkit after %!tests that alter it. diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/allchild.m --- a/scripts/plot/allchild.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/allchild.m Mon Jul 29 12:23:10 2013 -0700 @@ -44,9 +44,8 @@ %!testif HAVE_FLTK -%! toolkit = graphics_toolkit (); -%! graphics_toolkit ("fltk"); -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("fltk"); +%! hf = figure ("visible", "off") %! unwind_protect %! l = line; %! assert (get (allchild (hf),"type"),{"axes"; "uimenu"; "uimenu"; "uimenu"}); diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/findall.m --- a/scripts/plot/findall.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/findall.m Mon Jul 29 12:23:10 2013 -0700 @@ -45,9 +45,8 @@ %!testif HAVE_FLTK -%! toolkit = graphics_toolkit (); -%! graphics_toolkit ("fltk"); -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("fltk"); +%! hf = figure ("visible", "off") %! unwind_protect %! h = findall (hf); %! all_handles(1:13,1) = {"uimenu"}; diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/findobj.m --- a/scripts/plot/findobj.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/findobj.m Mon Jul 29 12:23:10 2013 -0700 @@ -316,8 +316,8 @@ %! assert (h2, h1) %!test -%! graphics_toolkit gnuplot; -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("gnuplot"); +%! hf = figure ("visible", "off") %! unwind_protect %! h1 = subplot (2, 2, 1); %! h2 = subplot (2, 2, 2); @@ -328,12 +328,13 @@ %! h = findobj (hf, "userdata", userdata); %! unwind_protect_cleanup %! close (hf); +%! graphics_toolkit (toolkit); %! end_unwind_protect %! assert (h, h3) %!test -%! graphics_toolkit gnuplot; -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("gnuplot"); +%! hf = figure ("visible", "off") %! unwind_protect %! h1 = subplot (2, 2, 1); %! set (h1, 'tag', '1') @@ -346,6 +347,7 @@ %! h = findobj (hf, 'type', 'axes', '-not', 'tag', '1'); %! unwind_protect_cleanup %! close (hf); +%! graphics_toolkit (toolkit); %! end_unwind_protect %! assert (h, [h2; h3; h4]) diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/graphics_toolkit.m --- a/scripts/plot/graphics_toolkit.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/graphics_toolkit.m Mon Jul 29 12:23:10 2013 -0700 @@ -90,10 +90,10 @@ %!testif HAVE_FLTK %! unwind_protect -%! hf = figure ("visible", "off"); +%! hf = figure ("visible", "off"); %! toolkit = graphics_toolkit (); %! assert (get (0, "defaultfigure__graphics_toolkit__"), toolkit); -%! graphics_toolkit (hf, "fltk"); +%! graphics_toolkit (hf, "fltk"); %! assert (graphics_toolkit (hf), "fltk"); %! unwind_protect_cleanup %! close (hf); diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/legend.m --- a/scripts/plot/legend.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/legend.m Mon Jul 29 12:23:10 2013 -0700 @@ -1547,8 +1547,8 @@ %! legend (option); %!test -%! graphics_toolkit ("gnuplot"); -%! h = figure ("visible", "off", "__graphics_toolkit__", "gnuplot"); +%! toolkit = graphics_toolkit ("gnuplot"); +%! h = figure ("visible", "off") %! unwind_protect %! position = get (h, "position"); %! plot (rand (3)); @@ -1559,5 +1559,6 @@ %! assert (get (h, "position"), position); %! unwind_protect_cleanup %! close (h); +%! graphics_toolkit (toolkit); %! end_unwind_protect diff -r 054905bfc306 -r dbd64c9a16da scripts/plot/uimenu.m --- a/scripts/plot/uimenu.m Mon Jul 29 15:04:52 2013 -0400 +++ b/scripts/plot/uimenu.m Mon Jul 29 12:23:10 2013 -0700 @@ -101,9 +101,8 @@ %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)'); %!testif HAVE_FLTK -%! toolkit = graphics_toolkit (); -%! graphics_toolkit ("fltk"); -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("fltk"); +%! hf = figure ("visible", "off") %! unwind_protect %! ui = uimenu ("label", "mylabel"); %! assert (findobj (hf, "type", "uimenu"), ui); @@ -119,9 +118,8 @@ %% check for top level menus file, edit, and help %!testif HAVE_FLTK -%! toolkit = graphics_toolkit (); -%! graphics_toolkit ("fltk"); -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("fltk"); +%! hf = figure ("visible", "off") %! unwind_protect %! uif = findall (hf, "label", "&file"); %! assert (ishghandle (uif)); @@ -135,9 +133,8 @@ %! end_unwind_protect %!testif HAVE_FLTK -%! toolkit = graphics_toolkit (); -%! graphics_toolkit ("fltk"); -%! hf = figure ("visible", "off"); +%! toolkit = graphics_toolkit ("fltk"); +%! hf = figure ("visible", "off") %! unwind_protect %! uie = findall (hf, "label", "&edit"); %! myui = uimenu (uie, "label", "mylabel");