• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSToolbarItem Action Not Passed to NSButton...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSToolbarItem Action Not Passed to NSButton...


  • Subject: Re: NSToolbarItem Action Not Passed to NSButton...
  • From: Andy Lee <email@hidden>
  • Date: Fri, 25 Apr 2014 23:06:49 -0400

On Apr 25, 2014, at 5:52 PM, "Peters, Brandon" <email@hidden> 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 <email@hidden> 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 (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


  • Follow-Ups:
    • Re: NSToolbarItem Action Not Passed to NSButton...
      • From: "Peters, Brandon" <email@hidden>
References: 
 >NSToolbarItem Action Not Passed to NSButton... (From: "Peters, Brandon" <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: Andy Lee <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: "Peters, Brandon" <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: Andy Lee <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: "Peters, Brandon" <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: Andy Lee <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: "Peters, Brandon" <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: Andy Lee <email@hidden>)
 >Re: NSToolbarItem Action Not Passed to NSButton... (From: "Peters, Brandon" <email@hidden>)

  • Prev by Date: Re: GCD killed my performance
  • Next by Date: Re: GCD killed my performance
  • Previous by thread: Re: NSToolbarItem Action Not Passed to NSButton...
  • Next by thread: Re: NSToolbarItem Action Not Passed to NSButton...
  • Index(es):
    • Date
    • Thread