开发者

At what level is selection handled in the Cocoa text system?

I noticed that if you hook up two NSTextViews to the same NSTextStorage object, you can select across the two and copy/und开发者_如何学运维o/etc. as if they were one. At what level is this all managed? Where should I get the combined selected range from?


Selection is managed in NSLayoutManager. It seems, your two views connected to the same layout manager like on this picture.

If you use more then one layout manager with the text storage, you could get the combined selected range by combining the individual selectedRanges: of all the NSTextViews.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜