Re: NSToolbarItem view set to NSButton view, but not showing...
Re: NSToolbarItem view set to NSButton view, but not showing...
- Subject: Re: NSToolbarItem view set to NSButton view, but not showing...
- From: "Peters, Brandon" <email@hidden>
- Date: Wed, 23 Apr 2014 23:59:55 +0000
- Thread-topic: NSToolbarItem view set to NSButton view, but not showing...
Jerry,
The example I was following comes from Stack Overflow and going something like this within the custom toolbar item:
NSButton *button = [[NSButton alloc]init];
[button setImage:[NSImage imageNamed:@"StarEmpty"]];
[button setAlternateImage:[NSImage imageNamed:@"StarFull"]];
[button setImagePosition:NSImageOnly];
[button setBordered:NO];
[self.toolbarItem setView:button];
At any rate, I tried your suggestion and I still got nothing. I will continue to hammer at it, but if not I will just get rid of the toolbar roll some custom NSButtons. Thanks.
On Apr 23, 2014, at 6:36 PM, Jerry Krinock <email@hidden<mailto:email@hidden>> wrote:
On 2014 Apr 23, at 15:13, Peters, Brandon <email@hidden<mailto:email@hidden>> wrote:
call [toolbaritem setView:view] and pass in the NSButton.
Try some bonehead debugging with NSLog(). Verify that toolbaritem is your target item at that point, in particular, that it is not nil. If that seems to be OK, try some more advanced debugging, later, and see if toolbaritem is still alive, and if so what is its view.
Also, NSToolbar/Item are kind of crazy cats and customizing them is often found to be problematic. If possible, use the default NSToolbarItem and -setImage:.
_______________________________________________
Cocoa-dev mailing list (email@hidden<mailto: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<http://lists.apple.com>
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
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