• 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: Dealing with NSPopupButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dealing with NSPopupButton


  • Subject: Re: Dealing with NSPopupButton
  • From: email@hidden
  • Date: Sat, 23 Feb 2002 07:40:29 -0500

You can also use sender. You can also set up the names from within IB.
You can do it without having a target, but just having an outlet to that
popup and get the information later when you need it.

Nick

On Saturday, February 23, 2002, at 07:03 AM, Pete Yandell wrote:

You only need to set a target for the popup menu, not for each
individual item.

Try something like this to build the menu, probably in your awakeFromNib
method:

[myPopUp addItemWithTitle:@"Letter"];
[myPopUp addItemWithTitle:@"Legal"];
[myPopUp addItemWithTitle:@"A4"];

And then, the target for your popup should look like:

- (IBAction)menuChanged:(id)sender
{
if ([[myPopUp titleOfSelectedItem] isEqualToString:@"Letter"]) {
...
}
else if (...) {

}
}

You get the idea. You can also use indexOfSelectedItem method to get
the index.

On Saturday, February 23, 2002, at 03:50 PM, Ben Mackin wrote:

Ok, I am new and have asked a few questions on this list, and have gotten
some great responses.

New question now. I have created an Popup menu in interface builder. Do I
need to setup the popup menu it self as a target, or each individual
menu In
the popup menu as a target? Did that make sense?

I have a menu with 3 choices: Letter, Legal, A4

I want to be able to find out what the user choose, and act accordingly.

Thanks,
Ben

http://www.shayufilms.com
_______________________________________________
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.


Pete Yandell
http://pete.yandell.com/


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
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.

  • Prev by Date: forcing custom behavior
  • Next by Date: Re: Dealing with NSPopupButton
  • Previous by thread: Re: Dealing with NSPopupButton
  • Next by thread: 2D menu
  • Index(es):
    • Date
    • Thread