Aperture Plugin: Continuous Example File Name Updates

cocoasmall
There is a problem with the current interface: the user has to type in the prefix and postfix strings and then tab away from the field to end the editing. Until that happens, the example file name does not get updated. What I want is for the text fields to update the example file name continuously with each key press.

To do this I have to set up my Random_Wok object as the delegate to the text fields. If my Random_Wok class provides a -controlTextDidChange: method, then as a delegate, the NSTextField instances will call it for each change of the text.

I set up Random_Wok as the delegate in -willBeActivated: for each of the text fields:
rwok80
And provide a way to distinguish between the fields by giving them tags:
rwok81
I give them numbers 0, 1, and 2. Then I code the delegate to update the appropriate string and remake and display the example string on each call:
rwok82
And that works. Typing, deleting, pasting, any change to the text fields is reflected in an immediate change in the example filename.

The other parts of this series can be found via the Cocoa page.
The Bagelturf site welcomes Donations of any size