Subclassing an NSDrawer's contentView to implement a completely custom drawer

前端 未结 2 1204
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 05:13

I want to implement my own custom drawer completely by subclassing NSView and doing all my view drawing in that. I\'ve created a custom NSView class that does hardly anythin

2条回答
  •  粉色の甜心
    2021-01-15 05:27

    I made a custom drawer by subclassing NSWindow rather than NSDrawer. It was a lot of work. There is a private object, NSThemeFrame, that sits between a NSWindow and its contentView. To avoid using private API, you have to make a transparent window and let its contentView act like a NSThemeFrame. Matt Gallagher shows how: http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html

提交回复
热议问题