I'm adding sharing to my OSX app, and I want to use a toolbar item to invoke it.

This ends up calling [NSSharingServicePicker showRelativeToRect: 
ofView:preferredEdge:]; which shows a menu of available sharing services for 
the data, allows me to select one and handles the rest.

Unfortunately, this method doesn't fit the situation when called by a 
NSToolbarItem. The toolbar item calls an action method which calls the above, 
but with a toolbar item as sender there is no rect nor a view that can be 
obtained to supply the method.

In addition, the method above logs the following complaint: Warning: 
-[NSSharingServicePicker showRelativeToRect: ofView: preferredEdge:] should not 
be called on mouseUp
Please configure the sender with -[NSControl sendActionOn:NSLeftMouseDownMask];

It's not possible to configure a NSToolbarItem in this way - it is not a 
NSControl subclass.


I've tried making the toolbar item a popup (doesn't work at all) and a button 
(works, but the icon ends up tiny and it does not look right as a button).

Has anyone got this to work? What's the correct way to make a "Share" toolbar 
item?

--Graham



_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to