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.
精彩评论