NeXT5tep
NeXT5tep

Reputation: 881

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

The twitter app has a float window when you click the contextual menu "Tweet",is it a NSPanel? How to?

Upvotes: 1

Views: 4693

Answers (2)

Graham Miln
Graham Miln

Reputation: 2792

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:

alt text

Upvotes: 4

Reed Olsen
Reed Olsen

Reputation: 9169

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

Upvotes: 1

Related Questions