| The following example shows how to access the callback object's handle as well as the handle of the figure that contains the object from the callback function. function button_down(src,evnt) % src - the object that is the source of the event % evnt - empty for this property sel_typ = get(gcbf,'SelectionType') switch sel_typ case 'normal' disp('User clicked left-mouse button') set(src,'Selected','on') case 'extend' disp('User did a shift-click') set(src,'Selected','on') case 'alt' disp('User did a control-click') set(src,'Selected','on') set(src,'SelectionHighlight','off') end end Suppose h is the handle of a line object and that the button_down function is on your MATLAB path. The following statement assigns the function above to the ButtonDownFcn: set(h,'ButtonDownFcn',@button_down) See "Function Handle Callbacks" for information on how to use function handles to define the callback function. Children vector of handles The empty matrix; line objects have no children. Clipping {on} | off |