The reason this does not work is because textDidChange_it is not a delegate method. This is a method on NSTextFieldthat sends a change notification. If you look in the docs for textDidChange, you will see that it mentions the actual delegate method name:
This method causes the recipient delegate to receive the controlTextDidChange: message. See the NSControl class specification for more information on the text delegate method.
Delegate method is actually called controlTextDidChange_, and declared in a superclass NSTextField, NSControl.
Change your delegation method to:
def controlTextDidChange_(self, notification):
NSLog("textdidchange")
and it should work for you.
source
share