开发者

how to show popup on insertion point on hot key press

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜