简体   繁体   中英

Custom tooltip that can overhang NSWindow?

I need to create a custom tooltip for my app yet I want it to act like a normal tooltip and overhang the top level window if the cursor is near the bottom or right edges. Do I need to make the tooltip control an NSWindow itself or is there a way to get an nsview to pop outside the window bounds.

So the solution for this was to create an NSPanel that is setFloatingPanel:YES. On mouse enter of the view I call orderToFront on the panel, on mouse move I setFrameOrigin and on mouse exit I orderOut.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM