开发者

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

开发者 https://www.devze.com 2023-01-29 16:53 出处:网络
I want to use a free form shape (e.g. A partially transparent image) as a window backgound without th开发者_开发百科e standard close and maximise buttons. Like the widgets do. Is that possible in OSX?

I want to use a free form shape (e.g. A partially transparent image) as a window backgound without th开发者_开发百科e standard close and maximise buttons. Like the widgets do. Is that possible in OSX? I could not find any info on that or an app that uses this.

Thanks


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

精彩评论

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