You can achieve this using the mouse movement listener as follows:
function init()
%
h = figure('WindowButtonMotionFcn',@windowMotion,'Pos',[400,400,200,200]);
%
col = get(h,'color');
lbl = uicontrol('Style','text', 'Pos',[10,160,120,20], ...
'Background',col, 'HorizontalAlignment','left');
drawnow;
setptr(gcf, 'fleur'); %
function windowMotion(varargin)
cursor_pos = get(h,'CurrentPoint');
set(lbl,'String',sprintf('Mouse position: %d, %d',cursor_pos));
drawnow;
pos = get(lbl,'position'); %
%
if (cursor_pos(1)>pos(1) && cursor_pos(1)<pos(1)+pos(3)) && ...
(cursor_pos(2)>pos(2) && cursor_pos(2)<pos(2)+pos(4))
setptr(gcf, 'hand'); %
%
else
setptr(gcf, 'fleur'); %
end
end
end
, if switch-case ( , , - ).
UndocumentedMatlab. MATLAB .
GUIDE, . . , lbl handles.tag_of_statictxt h ( gcf gcbo).
