Mercurial > hg > octave-lyh
comparison scripts/plot/findobj.m @ 17111:dbd64c9a16da
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.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 29 Jul 2013 12:23:10 -0700 |
parents | 562301c71bd3 |
children | bd50e0660545 |
comparison
equal
deleted
inserted
replaced
17110:054905bfc306 | 17111:dbd64c9a16da |
---|---|
314 %! close (hf); | 314 %! close (hf); |
315 %! end_unwind_protect | 315 %! end_unwind_protect |
316 %! assert (h2, h1) | 316 %! assert (h2, h1) |
317 | 317 |
318 %!test | 318 %!test |
319 %! graphics_toolkit gnuplot; | 319 %! toolkit = graphics_toolkit ("gnuplot"); |
320 %! hf = figure ("visible", "off"); | 320 %! hf = figure ("visible", "off") |
321 %! unwind_protect | 321 %! unwind_protect |
322 %! h1 = subplot (2, 2, 1); | 322 %! h1 = subplot (2, 2, 1); |
323 %! h2 = subplot (2, 2, 2); | 323 %! h2 = subplot (2, 2, 2); |
324 %! h3 = subplot (2, 2, 3); | 324 %! h3 = subplot (2, 2, 3); |
325 %! h4 = subplot (2, 2, 4); | 325 %! h4 = subplot (2, 2, 4); |
326 %! userdata = struct ("foo", "bar"); | 326 %! userdata = struct ("foo", "bar"); |
327 %! set (h3, "userdata", userdata); | 327 %! set (h3, "userdata", userdata); |
328 %! h = findobj (hf, "userdata", userdata); | 328 %! h = findobj (hf, "userdata", userdata); |
329 %! unwind_protect_cleanup | 329 %! unwind_protect_cleanup |
330 %! close (hf); | 330 %! close (hf); |
331 %! graphics_toolkit (toolkit); | |
331 %! end_unwind_protect | 332 %! end_unwind_protect |
332 %! assert (h, h3) | 333 %! assert (h, h3) |
333 | 334 |
334 %!test | 335 %!test |
335 %! graphics_toolkit gnuplot; | 336 %! toolkit = graphics_toolkit ("gnuplot"); |
336 %! hf = figure ("visible", "off"); | 337 %! hf = figure ("visible", "off") |
337 %! unwind_protect | 338 %! unwind_protect |
338 %! h1 = subplot (2, 2, 1); | 339 %! h1 = subplot (2, 2, 1); |
339 %! set (h1, 'tag', '1') | 340 %! set (h1, 'tag', '1') |
340 %! h2 = subplot (2, 2, 2); | 341 %! h2 = subplot (2, 2, 2); |
341 %! set (h2, 'tag', '2') | 342 %! set (h2, 'tag', '2') |
344 %! h4 = subplot (2, 2, 4); | 345 %! h4 = subplot (2, 2, 4); |
345 %! set (h4, 'tag', '4') | 346 %! set (h4, 'tag', '4') |
346 %! h = findobj (hf, 'type', 'axes', '-not', 'tag', '1'); | 347 %! h = findobj (hf, 'type', 'axes', '-not', 'tag', '1'); |
347 %! unwind_protect_cleanup | 348 %! unwind_protect_cleanup |
348 %! close (hf); | 349 %! close (hf); |
350 %! graphics_toolkit (toolkit); | |
349 %! end_unwind_protect | 351 %! end_unwind_protect |
350 %! assert (h, [h2; h3; h4]) | 352 %! assert (h, [h2; h3; h4]) |
351 | 353 |
352 %!test | 354 %!test |
353 %! hf = figure ("visible", "off"); | 355 %! hf = figure ("visible", "off"); |