• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
End editing in an NSComboBox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: End editing in an NSComboBox
      • From: Ryan Britton <email@hidden>
  • Prev by Date: Will this code work?
  • Next by Date: Re: End editing in an NSComboBox
  • Previous by thread: Will this code work?
  • Next by thread: Re: End editing in an NSComboBox
  • Index(es):
    • Date
    • Thread