开发者

how to show popup on insertion point on hot key press

开发者 https://www.devze.com 2023-03-15 09:32 出处:网络
I want to know, how apple\'s dictionary app is showing popup on pressing cmd+ctrl+d on word in any application. Please let me know how I\'ll achieve the same 开发者_如何学Gofor my cocoa app.I guess yo

I want to know, how apple's dictionary app is showing popup on pressing cmd+ctrl+d on word in any application. Please let me know how I'll achieve the same 开发者_如何学Gofor my cocoa app.


I guess you get the selection's position with NSRect insertionRect=[[self layoutManager] boundingRectForGlyphRange:[self selectedRange] inTextContainer:[self textContainer]] and then create that popup using insertionRect.origin as the origin of its frame.

0

精彩评论

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