Prev: rescaling for fmincon
Next: Minutes past Midnight
From: JoeyB on 5 Aug 2010 08:16 Another suggestion/Question: Any way to have the event system throw a warning when it can't find an event handler ftn in the proper scope w/ the proper signature? As of now, it just silently doesn't call the ftn if there's a problem. addlistener, when called, should come back and say I'm smoking rope if I think what I'm asking for will work and here's why. Now, it gives no clues why. No way of watching the event 'stack' per se? If I knew what I was doing wrong, I'd have a better chance of fixing it.
From: JoeyB on 5 Aug 2010 17:01
Starting to answer my own questions. For those interested, spend some time and read up on the different types of functions - nested, primary, subfunctions, etc. anonymous functions specifically. Realize that anonymous ftn handles pick up variables in scope when they are created. Understand variable scope in nested ftns. And, finally, realize that addlistener must be called with a OBJECT of the type defining the event. NOT a class reference even if the class has static methods to invoke the events. |