several question about addlistener's input arguments

조회 수: 2 (최근 30일)
fa wu
fa wu 2023년 8월 3일
1、Are there two forms or three forms?
two:
el = addlistener(hSource,EventName,callback)
el = addlistener(hSource,PropertyName,EventName,callback)
three:
el = addlistener(hSource,EventName,callback)
el = addlistener(hSource,PropertyName,EventName,callback)
addlistener(___)
2、Does this grammar match this example?
el = addlistener(hSource,PropertyName,EventName,callback)
propListener = addlistener(fig,'Color','PostSet',@(src,evnt)disp('Color changed'));
if it is,that means PropertyName='Color' EventName='PostSet'??
but I think it's weird.'PostSet' seems like an option.because it "Event Occurs" is "Immediately after the property value is set"
3、if the classes don't build in a set or get method, is it unnecessary to use this format "el = addlistener(hSource,PropertyName,EventName,callback)" ?
4、what situation do I need to use PreSet PreGet?
PreSet:Immediately before the property value is set, before calling its set access method
PreGet:Immediately before a property value query is serviced, before calling its get access method
Whose “property”? The Event source property?
If it is Event source property,it is weird!
“before………………” who is going to react to this?notifycallbackfunction
Why is it ’before’ ,not ’after’?’ befor……set’,that means event didn't change? If it is ,Why the listener should react befor event change?

답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by