1 ## Copyright (C) 2010-2012 Ben Abbott
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2 of the License, or
6 ## (at your option) any later version.
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with Octave; see the file COPYING. If not, see
15 ## <http://www.gnu.org/licenses/>.
18 ## @deftypefn {Function File} {} rmappdata (@var{h}, @var{name})
19 ## Delete the named application data for the object(s) with
23 ## Author: Ben Abbott <bpabbott@mac.com>
24 ## Created: 2010-07-15
26 function rmappdata (h, varargin)
28 if (! (all (ishandle (h)) && iscellstr (varargin)))
29 error ("rmappdata: invalid input");
33 appdata = get (h(nh), "__appdata__");
34 appdata = rmfield (appdata, varargin);
35 set (h(nh), "__appdata__", appdata);
41 %! setappdata (0, "hello", "world")
42 %! rmappdata (0, "hello")
43 %! assert (isappdata (0, "hello"), false)