Re: Full-Height Toolbar Item

2012-01-28 Thread Mark Alldritt

On 2012-01-27, at 12:00 PM, Jens Alfke wrote:

> There's probably a private API for that. The bad news is that Apple apps use 
> a lot of private APIs :( The good news is that these APIs often become public 
> in later OS releases, especially if developers file bugs clamoring for them 
> (hint hint).

Done: 10770991

Cheers
-Mark


___

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


Re: Full-Height Toolbar Item

2012-01-27 Thread Preston Sumner
On Jan 26, 2012, at 5:28 PM, Mark Alldritt wrote:

> Hi Everyone,
> 
> I'm looking for a way to make a view-based Toolbar Item that occupies the 
> full height of the toolbar (i.e. including the space normally reserved for 
> the toolbar item's label).  Xcode 4 does this for its "status" display, and I 
> have a similar need in my application.  The NSToolbar and NSToolbarItem 
> definitions don't appear to make this possible, but perhaps there is 
> something I've overlooked.
> 
> Thanks
> -Mark

Actually, I believe the status display is a subwindow. You used to be able to 
highlight it as its own window when taking a screenshot. Note that you can't 
customize Xcode 4's toolbar.

Preston
___

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


Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 27, 2012, at 12:27 PM, Jens Alfke wrote:
> The good news is that these APIs often become public in later OS releases, 
> especially if developers file bugs clamoring for them (hint hint).

Done: bug 10766939.

-- 
David Catmull
uncom...@uncommonplace.com



___

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


Re: Full-Height Toolbar Item

2012-01-27 Thread Jens Alfke

On Jan 27, 2012, at 8:51 AM, David Catmull wrote:

> I've looked into this too, and haven't found an answer yet. According to this 
> article, Xcode used to use a floating window trick:
> http://stackoverflow.com/questions/6169255/is-it-possible-to-draw-in-the-label-area-of-nstoolbar
> ..but it doesn't anymore. Also note that Instruments has a full-height 
> toolbar item, and that toolbar is fully customizable, so whatever tricks 
> they're using they were able to make it behave like a normal toolbar item - 
> cmd-draggable, in customize sheet, etc.

There's probably a private API for that. The bad news is that Apple apps use a 
lot of private APIs :( The good news is that these APIs often become public in 
later OS releases, especially if developers file bugs clamoring for them (hint 
hint).

—Jens

___

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

Re: Full-Height Toolbar Item

2012-01-27 Thread John Pannell
Hi Mark-

I have an app that has such an appearance…

http://www.positivespinmedia.com/BombSquad/screenshots.html

There's a couple ways to go about it… in a different project, I used NSToolbar, 
but disabled customization for it and set it to display "Icon-only" (no labels).

[toolbar setAllowsUserCustomization:NO];
[toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];

I then made sure my other "button-like" toolbar elements had labels as part of 
the view the item presented (all of the toolbar items were containers that were 
NSView subclasses), and a button sized appropriately.  Looked great, but didn't 
allow the user to shut off the label display for the buttons, nor did it allow 
for toolbar customization.

In BombSquad, I had special needs in terms of the layout of the status display: 
it had to remain centered until the window compressed to a certain point, and 
then it had to ease the status display over to the left to allow the display 
and single button to layout in an appealing fashion as the window squished down 
to min width.  NSToolbar will not provide sufficient control over the centering 
of the status view, nor will it do custom layout, so I just wrote my own 
container view to layout the subviews as desired during its own resize.  Once 
again, no toolbar customization, but this was fine for this case.

If I was doing this for something that is going to look and function like 
Xcode's toolbar, I would stick with an NSToolbar subclass, use  
NSToolbarDisplayModeIconOnly, use container views as toolbar items, and have my 
container views center layout vertically.  Inside each container view will be 
the control above the label.  Override setDisplayMode: and when you get a new 
display mode, leave the toolbar's display mode to NSToolbarDisplayModeIconOnly 
and show/hide your labels in their container views.

Hope this helps!

John


John Pannell
http://www.positivespinmedia.com


On Jan 26, 2012, at 5:28 PM, Mark Alldritt wrote:

> Hi Everyone,
> 
> I'm looking for a way to make a view-based Toolbar Item that occupies the 
> full height of the toolbar (i.e. including the space normally reserved for 
> the toolbar item's label).  Xcode 4 does this for its "status" display, and I 
> have a similar need in my application.  The NSToolbar and NSToolbarItem 
> definitions don't appear to make this possible, but perhaps there is 
> something I've overlooked.
> 
> Thanks
> -Mark
> 
> 


___

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

Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 26, 2012, at 9:03 PM, Mark Alldritt  wrote:
> I'm looking for a way to make a view-based Toolbar Item that occupies the 
> full height of the toolbar (i.e. including the space normally reserved for 
> the toolbar item's label).  Xcode 4 does this for its "status" display, and I 
> have a similar need in my application.  The NSToolbar and NSToolbarItem 
> definitions don't appear to make this possible, but perhaps there is 
> something I've overlooked.


I've looked into this too, and haven't found an answer yet. According to this 
article, Xcode used to use a floating window trick:
http://stackoverflow.com/questions/6169255/is-it-possible-to-draw-in-the-label-area-of-nstoolbar

..but it doesn't anymore. Also note that Instruments has a full-height toolbar 
item, and that toolbar is fully customizable, so whatever tricks they're using 
they were able to make it behave like a normal toolbar item - cmd-draggable, in 
customize sheet, etc.
___

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