[TxMt] tm_dialog/ib question

Jay Soffian jay-txmt at soffian.org
Tue Nov 14 23:10:05 UTC 2006


Not sure if this is possible or not.

I'd like to setup a window that has an editable text field along with  
a drop-down of options. If the user selects an item from the drop- 
down, that items value should populate the text field. When the user  
is done with the window I want whatever is in the text field, whether  
manually typed or pre-populated from the drop-down to be returned by  
tm_dialog.

This is similar to what Allan shows in his screencast, except that  
instead of an TSTableView I'm using an NSPopUpButton. Also, I want  
the NSTextField to be editable, but I don't want anything the user  
types there to update the NSAraryController/NSPopUpButton.

I've almost got this working. I've setup an NSArrayController that  
I'm populating via tm_dialog. I've bound the NSPopUpButtons's  
contentValues to the NSArray Controller. However, whenever I edit the  
text field it ends up updating the drop-down. Doh.

Also, I want to give this window working Cancel/Okay buttons.

Is this doable? Do I need to use IB Connections instead of bindings  
to tie the pop-up to the text field?

Hints/Tips appreciated,

j.






More information about the textmate mailing list