Controlling mouse pointer and responsiveness for the whole window in App Designer
4 ビュー (過去 30 日間)
When my app is about to start a lengthy operation, such as running a system process and waiting for its result, I want to first change the uifigure's Pointer property to 'watch' to indicate to the user that they can expect it to take some time. I usually add an onCleanup() object to revert the mouse back to 'arrow' in case the operetion fails somehow.
Problem is, the pointer change does not apply when the mouse is over some of the controls, apparently those that don't have a different pointer. Edit fields (and similar ones like spinner) show the i-beam pointer, and ignore the figure's property, even if they are not editable (this looks like a bug - these non-editable fields do not show the i-beam when the pointer is set to 'arrow').
On the other hand, when the mouse is over buttons, checkboxes etc. the pointer does change to 'watch' even though the controls are still responsive. The expected behavior when the mouse is 'watch' is to have these controls not respond to clicks, but disabling and enabling all controls individually is a big hassle.
Ideally the 'watch" pointer should apply to the whole figure and all controls should be set to ignore mouse clicks until the operation is finished. But the controls do not have a "Pointer" property and the figure does not have an "Enable" property.
I considered using a modal message box instead, but it makes no sense because the user has nothing to do except wait for the operation to complete. It is not the bebavior people are used to have in such cases.
Is there a way to apply the 'watch' pointer to the edit boxes? Is there a way to globally disable/enable all controls ?
回答 (1 件)
Voss 2023 年 11 月 20 日
"Is there a way to globally disable/enable all controls ?"
Yes. Where f is your uifigure:
h = findall(f,'-property','Enable');
set(h,'Enable','off') % disable
set(h,'Enable','on') % enable