function clearobject(pos) %CLEAROBJECT Clear the objects inside the rect % Clearobject - clears buttons in the variable button frame % pos is a vectors of 4 numbers that defines the area in which % delete the uicontrols % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global Handlefig j = get(Handlefig,'Children'); % get returns a vector of handles to the children - get the size of the vectors into k(2) % k(1) contains the number of rows == the number of children k = size(j); % Perform a search of the children, get each child's position, and delete any children within % the buttonframe for i=1:k(1); childpos = get(j(i),'Position'); childtype=get(j(i),'Type'); if strcmp(get(j(i),'Type'),'uimenu') ~= 1 if childpos(1) > pos(1) & childpos(2) > pos(2) delete(j(i)); end end end return;