Is it posible to use free form shapes as windows in OSX?

后端 未结 1 1421
深忆病人
深忆病人 2021-01-15 08:38

I want to use a free form shape (e.g. A partially transparent image) as a window backgound without the standard close and maximise buttons. Like the widgets do. Is that poss

1条回答
  •  -上瘾入骨i
    2021-01-15 09:08

    Yes. You can do this by subclassing NSWindow to make it borderless and transparent. You'll also subclass NSView to draw the visible custom shape, then use an instance of this view as the window's content view. The result will be a window whose only visible parts will be the shape your content view draws.

    Here's a good article with an example.

    0 讨论(0)
提交回复
热议问题