How to change mouse arrow to hour-glass for a GUI created by GUIDE?

Hi,
Does anybody know how to change the mouse pointer from arrow to hour glass whenever it is located inside a GUI created by GUIDE?
I know for a figure the command is
set(gcf,'pointer','watch')
What should I change the gcf to refer to the entire GUI figure?
Thanks,
QM

1 Comment

What do you mean by "entire GUI figure"? The shown command should be sufficient actually.

Sign in to comment.

Answers (1)

Put the:
set(gcf,'pointer','watch')
at the bottom of the automatically generated OpeningFcn, e.g.:
function example_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to batz (see VARARGIN)
% Choose default command line output for example
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
set(gcf,'pointer','watch')

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Asked:

on 21 Sep 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!