End editing in an NSComboBox
End editing in an NSComboBox
- Subject: End editing in an NSComboBox
- From: Mike Blaguszewski <email@hidden>
- Date: Wed, 12 Jul 2006 12:56:17 -0400
In my GUI, I have an NSComboBox and a popup menu. When the popup menu
selection changes, an action fires which needs to access the current
value of the combo box. The problem is that if the cursor is in the
combo box, then -stringValue returns an empty string. If I tab to
another control before using the popup menu, it works. Plain
NSTextFields don't have this problem, and in fact the combo box
doesn't even seem to be the first responder. I just can't figure out
how to force it to end editing and commit its value. I've tried -
resignFirstResponder, -validateEditing, and even telling the window
to make itself the first responder (as suggested in a previous thread).
Is this a bug? Has anybody else run into this, or know some other way
of get the real current value of an NSComboBox? The combo box's value
is bound to an NSObjectController, if that makes a difference (though
the model isn't updating in this case either). I've got a partial
workaround using -[NSWindow fieldEditor:forObject:], but that could
get pretty messy.
Thanks for any help or ideas,
--
Mike Blaguszewski / Ambrosia Software, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden