MATLAB: Listening to events when Matlab GUI application is idle

eventguiMATLAB

Hi, I would appreciate a piece of advice. I have a GUI application. I am able to listen to events (answers from a geodetic instrument) when there is a process running in my application (e.g. measurement). But how to listen to events when the application is idle (no matlab activity currently active, no function running, no button pressed). Is there a function (to where write definition of listening to events) which is active when aplication window rises (program starts) and active until it is closed? Thanks for help Filip

Best Answer

An alternative might be to
  • create a handle class, which creates the listener in the constructor
In startup.m
  • create an instance
  • put a copy of the handle somewhere, e.g. setappdata(0,'my_name',h)