What events are available to add a listener to for uicontrol objects? (specifically push button)
6 次查看(过去 30 天)
显示 更早的评论
I have successfully added listeners for property changes with a popup menu via:
listener = addlistener(popupH, 'Value', 'PostSet', @testFcn2);
and for seeing user interaction with the figure containing the controls:
listener = addlistener(fh, 'WindowButtonDown', @testFcn);
etc from the documentation page Matlab > Graphics > Graphics Objects > Object Property Operations > "Callback Properties for Graphics Objects" and just deleting the 'Fcn' from the properties to get the event name.
But now I want to look more into responding to events of particular ui controls. I tried the following for a push button:
listener = addlistener(buttonH, 'ButtonDown', @testFcn);
but I get the error "The specified event is not supported by the object". So then I thought, I will just figure out which events a uicontrol object publishes. So I managed to get a real reference to the uicontrol push button object by successfully adding a listener to one of the property changes, breakpointing within my @testFcn, and calling
events(eventData.AffectedObject)
but it said "No events for class uicontrol".
Can someone shed some light on this for me? I just want to figure out how to look at the event names exported by ui controls.
Thanks! Will
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!