Re: Tabbed windows
Re: Tabbed windows
- Subject: Re: Tabbed windows
- From: PCWiz <email@hidden>
- Date: Sat, 30 Jan 2010 11:25:10 -0700
One way to do it (the way Chrome does it, if I'm not mistaken) is to add the toolbar view as a subview of NSThemeFrame. NSThemeFrame is a private subclass of NSView that can be accessed by using [[yourWindow contentView] superview]. Note, however, that this is entirely undocumented so use it at your own risk. You may need to do some tweaking to make the colors match between the window frame and the toolbar.
Another less hacky (and supported) way is to use a child window. Create a transparent child window using NSBorderlessWindowMask and set your toolbar view as the content view of that window. You can then position the window over the titlebar of your main window, then add the toolbar window as a child window of the main window. In my experience, however, one of the issues with this approach is that the child window doesn't seem to resize along with the main window, so you'd have to listen for the NSWindowDidResizeNotification from the main window and resize the child window accordingly.
hope this helps.
Independent Cocoa Developer, Macatomy Software
http://macatomy.com
On 2010-01-30, at 10:32 AM, Jens Alfke wrote:
>
> On Jan 29, 2010, at 3:40 PM, John Nairn wrote:
>
>> Is it possible for non-Apple program to integrate into the tool bar of the window?
>
> Google Chrome has tabs that are actually integrated into the title bar. It requires some fairly nasty hacking (splicing methods into private classes) so I wouldn't recommend it; but if you want to see how it's done, look in the Chromium.org open-source repository.
>
> —Jens
>
> _______________________________________________
>
> 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
_______________________________________________
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