Disable mouse click events

조회 수: 5 (최근 30일)
Ignacio
Ignacio 2014년 10월 23일
답변: Mads Kaern 2015년 4월 9일
Hi, I would like to disable temporarily the mouse click events on my application. I want to load with matlab an external application with the "winopen" instruction, and I want the focus on that new loaded application even when I press with the mouse in another screen Area which is not part of that opened application.
I think a logical solution would be disable the mouse click events but maybe there are another ways of doing that (somehow set the opened application as modal or somehow too disable the mouse during this application is opened...).
Thanks and any idea will be apreciated. Regards

답변 (1개)

Mads Kaern
Mads Kaern 2015년 4월 9일
I had a similar problem but could find on suitable solution online.
One can inactive buttons and other objects temporarily using the Enable property. In my application, I have a function that takes lot of time to complete, and I don't want the user to click anything until the result has been returned.
I make this possible, I found all the object that are currently active and inactivated them prior to the function call, and then reactivated them once the function had been executed
Before the function call: h = findobj(gcf,'Enable','on'); set(h,'Enable','inactive');
After the function call: set(h,'Enable','on');
Hope this helps
Mads

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by