Interacting with events and listeners in MATLAB -


i want write gui code orthogonal. lets have circle class , square class , need interact. right now, circle , square talking each other - circle object sends message square object, use square_obj.listen_for_circle(circle_obj) listen_for_circle method implements addlistener.

this problem me since 2 objects linked - , removing 1 object code break it. looking circle_obj able broadcast global message 'circle_event'. additionally square_obj listening global message broadcasts of type 'circle_event', , upon hearing event - action.(ahhh, objects have no links each other in code base!)

is possible or reasonable in matlab? (or maybe i'm going crazy). always, advice appreciated.

i'm not sure why addlistener problematic you. adds event listener doesn't if event-origin object (the circle) deleted.

alternately can use event.listener or handle.listener. undocumented work well, , used within matlab codebase (m-files). see explanation here: http://undocumentedmatlab.com/blog/continuous-slider-callback/#event_listener


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -