• 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: I'm somewhat new to Cocoa and I need some PopUpButton help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I'm somewhat new to Cocoa and I need some PopUpButton help


  • Subject: Re: I'm somewhat new to Cocoa and I need some PopUpButton help
  • From: "Jeffrey T. Hazelwood" <email@hidden>
  • Date: Sun, 16 Jun 2002 19:04:37 -0400

Sure, something like this will do the trick...

Define some variables in your header file:

IBOutlet id textField;
NSPopUpButton *yourPopUpButton;

then make some action like this:

- (IBAction)changeTextField:(id)sender
{
int popUpValue;
popUpValue = [[yourPopUpButton selectedItem] tag];

switch (popUpValue) {
case 0:
[textField setStringValue:@"You selected X "];
// you could change more textfield values here too
break;
case 1:
[textField setStringValue:@"You selected Y "];
// you could change more textfield values here too
break;

}

}

Just make sure to give your popupbutton values
a tag number first value 0, second 1, third, 2, etc....in interface builder





On Sunday, June 16, 2002, at 05:36 PM, Varun Mehta wrote:

I'm creating a program and I need an NSPopUpButton to be able to change the
values of certain NSTextFields when the user chooses something else from the
NSPopUpButton, but I don't see how this is possible. Does anyone have any
suggestions on how I can accomplish this?

Thanks,
Varun Mehta
_______________________________________________
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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: I'm somewhat new to Cocoa and I need some PopUpButton help
      • From: Varun Mehta <email@hidden>
References: 
 >I'm somewhat new to Cocoa and I need some PopUpButton help (From: Varun Mehta <email@hidden>)

  • Prev by Date: I'm somewhat new to Cocoa and I need some PopUpButton help
  • Next by Date: Re: I'm somewhat new to Cocoa and I need some PopUpButton help
  • Previous by thread: I'm somewhat new to Cocoa and I need some PopUpButton help
  • Next by thread: Re: I'm somewhat new to Cocoa and I need some PopUpButton help
  • Index(es):
    • Date
    • Thread