GUI in Busy Status - Block interactions in the Figure

5 views (last 30 days)
Hello,
I have a simple GUI, with menus, toolbars and axes. When I execute a long task, I want to change the cursor to a watch to inform the user that a task is currently beeing executed, and I want to forbid any call on the menus or toolbar until the task is done.
I basically do that: %Get Old Pointer old_pointer = get(figure_handle, 'Pointer');
% Set pointer to a Watch set(figure_handle, 'Pointer', 'watch') redraw;
% Execute my task task()
% Reset the old pointer set(figure_handle, 'Pointer', old_pointer);
Doing that is not enough. I have 2 main issues:
1. I can still click on menus and toolbars. It should be forbidden.
2. When I hover my mouse on top of toolbars or menus or outside of the figure, the pointer changes automatically to something else. When I go back to the axes, the pointer is back to what I imagine is the default pointer, an arrow, despite the fact that my task is still running.
I basically want the pointer to be a watch in any situation when the mouse is hovering over the window while the task is executing. And I want it impossible to click on a menu, or on the toolbar.
Any ideas how to do that?
Thanks
Erwan

Answers (1)

Geoff
Geoff on 19 Apr 2012
Maybe you could look at
doc uiwait
Dunno how to stop clicks on the menu/toolbar. But you could just hide them =)
set(gcf, 'ToolBar', 'none')
set(gcf, 'MenuBar', 'none')
Sorry this is a bit of a hack-job answer. But sometimes that's enough for someone's purposes.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!