On Apr 25, 2014, at 5:52 PM, "Peters, Brandon" <bap...@my.fsu.edu> wrote:
> Thank you for the guidance! Clicking twice on the toolbar item in IB revealed 
> the NSButton Attribute Inspector. However, now the images will not show 
> despite being set in IB. I tried programmatically to set the images for the 
> outlet NSButton and got error messages pertaining to “not ready yet”.

I've been experimenting some more with creating toolbars in IB, and I've been 
having some frustrations but I *am* able to easily create an image button like 
you're trying to do.

Did you remember to set the "Position" in IB?  I mean the segmented control 
right under where you specify the "Image" and "Alternate" names.

If that's not the problem, all I can think of is a long shot: check the min/max 
values for the size of the toolbar item (not the view, but the NSToolbarItem).  
They probably make sense, but it couldn't hurt to check.

I assume you've read the "Toolbar Programming Topics", but just in case:

<https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Toolbars/Toolbars.html>

I've been reading it (okay, skimming it) and learning some things myself.  
Perhaps I should have mentioned that the last time I set up an NSToolbar there 
*was* no UI in IB...

Out of curiosity -- why are you using a view-based toolbar item, when all it's 
doing is displaying an image that you could simply put into an image-based 
toolbar item?  Bear in mind that if the user chooses the "Text Only" option for 
their toolbar, you'll now have a non-functioning toolbar item, whereas an 
image-based toolbar item will still work.  Of course it would be nice to get 
your button working, if only as an exercise.  I'm just wondering if it makes 
sense UI-wise.

Anyway, I'm definitely seeing the wisdom of this now:

On Apr 23, 2014, at 6:36 PM, Jerry Krinock <je...@ieee.org> wrote:
> [...] NSToolbar/Item are kind of crazy cats and customizing them is often 
> found to be problematic.  If possible, use the default NSToolbarItem and 
> -setImage:.


--Andy

_______________________________________________

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

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

Reply via email to