Re: NSPathControl w/ popups and icons
Re: NSPathControl w/ popups and icons
- Subject: Re: NSPathControl w/ popups and icons
- From: Shane <email@hidden>
- Date: Fri, 6 Aug 2010 21:42:52 -0500
On Sat, Jul 31, 2010 at 7:44 PM, Shane
<email@hidden> wrote:
> I'm trying to create an NSPathControl where there are several items
> (components) within the row and each item (component) is a popup menu.
> And then I would populate each of those popups w/ items. But I'm
> having a problem in understanding if that's how it really works.
>
> I'm playing around w/ the following code. Can anyone offer guidance on
> using NSPathControl?
>
>
> NSPathComponentCell *cell1 = [[NSPathComponentCell alloc] init];
> [cell1 setTitle:@"cell 1"];
> [networkComponents addObject:cell1];
>
> NSPathComponentCell *cell2 = [[NSPathComponentCell alloc] init];
> [cell2 setTitle:@"cell 2"];
> [networkComponents addObject:cell2];
>
> NSMenu *pathMenu = [[NSMenu alloc] initWithTitle:@"Main"];
> NSMenuItem *pathItems = [[NSMenuItem alloc] initWithTitle:@"item #1"
> action:nil keyEquivalent:@""];
> NSMenuItem *pathItems2 = [[NSMenuItem alloc] initWithTitle:@"item #2"
> action:nil keyEquivalent:@""];
> [pathItems setSubmenu:pathMenu];
> [pathItems2 setSubmenu:pathMenu];
>
> [networkPathControl setMenu:pathMenu];
>
> // setStringValue works, but its' only 1 single popup that's empty unless
> // I click on it, then I see the string values
> //[networkPathControl setStringValue:@"cell 3 / cell 4"];
>
> //[networkPathControl setPathComponentCells:networkComponents];
> //[networkPathControl setBackgroundColor:[NSColor blueColor]];
> //[networkPathControl setNeedsDisplay:YES];
>
Shameless bump. Still can't get this working.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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