• 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: [newbie]: UI questions (using NSSlider & NSTextField with delegation)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [newbie]: UI questions (using NSSlider & NSTextField with delegation)


  • Subject: Re: [newbie]: UI questions (using NSSlider & NSTextField with delegation)
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Tue, 13 Aug 2002 07:50:43 -0400

On 08/13/2002 07:21, "email@hidden" <email@hidden> wrote:

> Thanks for the reply Martin, but I do have the slider & textfield hooked up
> through an outlet/action. This part works ok, i.e. I am able to have the
> textfield updated from the slider. It's just that even though the
> textfield has it's value updated from the slider, this value isn't sent to
> the textfield's delegate (my controller object in this case) unless I go in
> and manually hit return in the textfield or manually edit the text. Only
> then does the controller object get the update through delegation.

Don't hook the slider directly to the text field, instead, hook them
both up to your controller, and let it handle their interaction, like so:


-(IBAction)sliderOrTextFieldChanged:(id)sender
{
double value = [sender doubleValue]; //Or int, float, whatever

[slider setDoubleValue: value];
[textField setDoubleValue: value];

//Do something with value here
}

Then simply set the action of both the slider and the text field to
sliderOrTextFieldChanged:.

--
Clark S. Cox III
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: [newbie]: UI questions (using NSSlider & NSTextField with delegation) (From: email@hidden)

  • Prev by Date: Re: [TRTFM] Cocoa and AppleScript
  • Next by Date: NSURL, NSURLHandle, Proxies and Jaguar
  • Previous by thread: Re: [newbie]: UI questions (using NSSlider & NSTextField with delegation)
  • Next by thread: Undocumented Cocoa?
  • Index(es):
    • Date
    • Thread