Title Bar Buttons and Custom Title Bars
I have created a custom title bar view for a blackened NSWindow (style 0), so that I can have it disappear in a similar manner to Quicktime X. The only problem is, the buttons don't respond to mouse over and mouse move actions on the title bar can get combined with pressing in the buttons.
The full source code is here: https://github.com/iaefai/OrganicUI under Classes/ORTitleBar.m and ORWindow.m.
The buttons are standard from this method:
self.closeButton = [NSWindow standardWindowButton: NSWindowCloseButton
forStyleMask:NSTexturedBackgroundWindowMask];
Then positioned:
[self.closeButton setFrame: __frame];
Then added to th开发者_开发百科e titlebar:
[self addSubview: self.closeButton];
A small video of the disappearing title bar can be seen here: http://web.me.com/iaefai/OrganicUI/ORWindow.html
精彩评论