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!