• 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
Re: End editing in an NSComboBox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: End editing in an NSComboBox


  • Subject: Re: End editing in an NSComboBox
  • From: Ryan Britton <email@hidden>
  • Date: Wed, 12 Jul 2006 10:09:40 -0700

Have you tried [someWindow makeFirstResponder:nil] ? That has worked in the past for me. You could also try using the "Continuously updates value" binding flag. I'm not sure how that works on NSComboBox though since I've not used it there.


On Jul 12, 2006, at 9:56 AM, Mike Blaguszewski wrote:

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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:
    • [SOLVED] Re: End editing in an NSComboBox
      • From: Mike Blaguszewski <email@hidden>
References: 
 >End editing in an NSComboBox (From: Mike Blaguszewski <email@hidden>)

  • Prev by Date: End editing in an NSComboBox
  • Next by Date: Re: How to use NSPrintHeaderAndFooter
  • Previous by thread: End editing in an NSComboBox
  • Next by thread: [SOLVED] Re: End editing in an NSComboBox
  • Index(es):
    • Date
    • Thread