GUI in Busy Status - Block interactions in the Figure
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Geoff
el 19 de Abr. de 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.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!