time | Calls | line |
---|
| | 1 | function ObjList=findall(HandleList,varargin)
|
| | 2 | %FINDALL find all objects.
|
| | 3 | % ObjList=FINDALL(HandleList) returns the list of all objects
|
| | 4 | % beneath the Handles passed in. FINDOBJ is used and all objects
|
| | 5 | % including those with HandleVisibility set to 'off' are found.
|
| | 6 | % FINDALL is called exactly as FINDOBJ is called. For instance,
|
| | 7 | % ObjList=findall(HandleList,Param1,Val1,Param2,Val2, ...).
|
| | 8 | %
|
| | 9 | % Example:
|
| | 10 | % plot(1:10)
|
| | 11 | % xlabel xlab
|
| | 12 | % a=findall(gcf)
|
| | 13 | % b=findobj(gcf)
|
| | 14 | % c=findall(b,'Type','text') % return the xlabel handle twice
|
| | 15 | % d=findobj(b,'Type','text') % can't find the xlabel handle
|
| | 16 | %
|
| | 17 | % See also ALLCHILD, FINDOBJ.
|
| | 18 |
|
| | 19 | % Loren Dean
|
| | 20 | % Copyright 1984-2017 The MathWorks, Inc.
|
| | 21 |
|
| | 22 |
|
< 0.001 | 17 | 23 | if ~isa(HandleList,'matlab.graphics.Graphics') && nnz(~ishghandle(HandleList))
|
| | 24 | error(message('MATLAB:findall:InvalidHandles'));
|
| | 25 | end
|
| | 26 |
|
< 0.001 | 17 | 27 | rootobj = 0;
|
< 0.001 | 17 | 28 | if ~isempty( HandleList )
|
< 0.001 | 17 | 29 | rootobj = groot;
|
< 0.001 | 17 | 30 | end
|
| | 31 |
|
| | 32 | %Set up an onCleanup object that would restore the root global state after
|
| | 33 | %we do a findobj. We are explicitly making sure that there are no
|
| | 34 | %nested/anonymous functions involved here because findall executed through
|
| | 35 | %a timer callback is causing unexpected failure modes with onCleanup.
|
| | 36 | %Making a sub-function return an anonymous function handle is safer here.
|
0.010 | 17 | 37 | c = onCleanup(showHiddenHandlesToFindAllHandles(rootobj));
|
| | 38 |
|
| | 39 |
|
< 0.001 | 17 | 40 | try
|
0.035 | 17 | 41 | ObjList=findobj(HandleList,varargin{:});
|
| | 42 | catch ex %#ok
|
| | 43 | ObjList=-1;
|
| | 44 | end
|
| | 45 |
|
0.006 | 17 | 46 | if isequal(ObjList,-1)
|
| | 47 | error(message('MATLAB:findall:InvalidParameter'));
|
| | 48 | end
|
Other subfunctions in this file are not included in this listing.