I wrote an "Agent" Cocoa app where a TextField is in the status icon's menu. The icon menu is displayed as followed:
(source: ifotos.pl)
The stepper increments or decrements the value by 5. The purpose of the text field is to press the "up" or "down" keys which achieves the same result of the value being incremented or decremented by 5.
I have found out that following code must be used - (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
of NSControlTextEditingDelegate
protocol.
The problem I am currently encountering is how to implement the code. My normal approach is use sth.delegate = self;
. I attempted to search for an answer but the replies consisted of using to control:textView:...
. I was unable to learn how to use the delegate method even with further research.
Thank you in advance!