开发者

Title Bar Buttons and Custom Title Bars

开发者 https://www.devze.com 2023-01-31 22:55 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消