• 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
Changing a NSTextField's value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing a NSTextField's value


  • Subject: Changing a NSTextField's value
  • From: "Paul J. Lucas" <email@hidden>
  • Date: Tue, 28 Mar 2006 15:15:49 -0800 (PST)

	So I have a dialog box that has to NSTextFields: one for a width
	and one for a height.  I have code that keeps the aspect ratio
	the same, i.e., if the values are initially 100 and 100 and
	then you type 50 in one, the other changes to 50 as you type.
	This all works great.

	Now I've added a Rest button that, when clicked, is supposed to
	set the values back to their original values.

	If I click Reset when neither text field has focus, they both
	get reset and repainted; if I click Reset when one has focus and
	the entire value is selected, they also both get repainted;
	however, if the insertion-point cursor is blinking in one of
	them, that field doesn't get repainted.  It's like the fact that
	the cursor is there is preventing either the resetting or the
	repainting.

	FYI, I'm using [myField setIntValue:origX] to set reset the value.

	How do I get it to accept the new value and repaint even if the
	cursor is in the field -- OR -- how do I get the cursor out of
	the field (say by selecting the entire contents of the field)?

	- Paul
 _______________________________________________
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: Changing a NSTextField's value
      • From: "Paul J. Lucas" <email@hidden>
  • Prev by Date: Re: NSTableView + setObjectValue + NSCell
  • Next by Date: Re: Cocoa Application Server
  • Previous by thread: Syncospector does not work on 10.4.5
  • Next by thread: Re: Changing a NSTextField's value
  • Index(es):
    • Date
    • Thread