Hi,

I'm trying to create a toolbar with NSSegmentedControl as a custom view for an NSToolbarItemGroup in 10.6, but I can't get the labels for the subitems to appear.

I added an NSSegmentedControl to the toolbar item in IB and set images in the segmented control in IB. I did not give the NSToolbarGroupItem a label.

I added the following code to my appDelegate (oProjectsGroup is an IBOutlet, which is bound to the NSToolbarGroupItem in IB):

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
        // Insert code here to initialize your application
NSToolbarItem *item1 = [[[NSToolbarItem alloc] initWithItemIdentifier:@"Item1"] autorelease]; NSToolbarItem *item2 = [[[NSToolbarItem alloc] initWithItemIdentifier:@"Item2"] autorelease];
        [item1 setImage:[NSImage imageNamed:@"Activities"]];
        [item2 setImage:[NSImage imageNamed:@"Projects"]];
        [item1 setLabel:@"Prev"];
        [item2 setLabel:@"Next"];
        
[oProjectsGroup setSubitems:[NSArray arrayWithObjects:item1, item2, nil]];
        
        for (id item in [oProjectsGroup subitems]) {
                NSLog(@"label is %@", [item label]);
        }
}

The console displays the labels, so, apparently, the labels are being set, but they do not appear beneath their respective segments in the running app.

I've looked through the documentation and a list thread both of which seem to indicate that my code should be working....

Any help would be appreciated.


Thanks.

Brad
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to