问题
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 the 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
来源:https://stackoverflow.com/questions/4507278/title-bar-buttons-and-custom-title-bars