Re: Stupid problem with NSPopUpButton
Re: Stupid problem with NSPopUpButton
- Subject: Re: Stupid problem with NSPopUpButton
- From: Matt Covey <email@hidden>
- Date: Wed, 4 Sep 2002 05:05:05 -0700
>
Not the least of which is that by your description, the user has no way to determine which item he should choose in the popup before he chooses it.
As others have noted, having two items that are exactly the same in a popup is confusing (how does the user tell them apart?)
However, there are a few times when you want to have the same text label because you're able to distinguish between them by other means: they have different images, one item is plain, the other bold, they're placed in different "sections" in your popup, etc.
In this case you can use something like:
[popup_button addItemWithTitle: @"x"];
[[popup_button lastItem] setTitle: @"Duplicate text"];
[[popup_button lastItem] setImage: image_1];
[popup_button addItemWithTitle: @"x"];
[[popup_button lastItem] setTitle: @"Duplicate text"];
[[popup_button lastItem] setImage: image_2];
You probably also want to give them different tags (so _you_ can distinguish between them in your code):
[[popup_button lastItem] setTag: t1];
++matt
_______________________________________________
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.