Title Bar Buttons and Custom Title Bars

帅比萌擦擦* 提交于 2019-12-18 12:00:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!