开发者

How to create a float window floating above all other windows just like twitter?

开发者 https://www.devze.com 2023-02-05 09:29 出处:网络
The twitter app has a float window when you click t开发者_如何学Gohe contextual menu \"Tweet\",is it a NSPanel?

The twitter app has a float window when you click t开发者_如何学Gohe contextual menu "Tweet",is it a NSPanel? How to?


Take a look at NSWindow's setLevel: method:

Each level in the list groups windows within it in front of those in all preceding groups. Floating windows, for example, appear in front of all normal-level windows. When a window enters a new level, it’s ordered in front of all its peers in that level.

-- from NSWindow's setLevel: reference.

You may also find Matt Gemmell's MAAttachedWindow project helpful:

How to create a float window floating above all other windows just like twitter?


This can be achieved with an NSWindow subclass. Check Matt Gemmell's custom MAAttachedWindow class here.

0

精彩评论

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

关注公众号