[Cocoa] Design Question for an NSMenu subclass
[Cocoa] Design Question for an NSMenu subclass
- Subject: [Cocoa] Design Question for an NSMenu subclass
- From: "Alexander von Below" <email@hidden>
- Date: Wed, 18 Apr 2007 22:36:15 +0200
Hello List,
sorry that the subject is so close to meaningless, I hope that some people
read the post anyhow ...
My goal is to create a "control" (w.l.o.g. an NSPopUpButton) to display a
list of (actually, unmountable or ejectable) volumes and their icons. This
is not really a problem, and I have a sample project that you are welcome to
use for your own purposes. It also handles the adding and removing of
drives.
http://software.vonbelow.com/MenuTest.zip
Now the trouble starts: I would like to enable bindings for this control.
The naïve way of simple connecting to selectedValue does not seem to work --
it seems that in this case, the NSPopUpButton expects the content to be
delivered by binding, too.
I would have subclassed an NSArrayController, but I see no way of binding
the pictures in additon to the names. And at some point, the user should see
"nice" names, not the full device path.
So my question to the list is: Is subclassing NSMenu the right way to go?
If so, how do I get the right value into selectedValue for other objects to
use?
Your thoughts, hints, and ideas are appreciated!
Thanks
Alex
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden