Drawing selection box (rubberbanding, marching ants) in Cocoa, ObjectiveC

后端 未结 4 1137
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 07:28

I\'ve currently implemented a simple selection box using mouse events and redrawing a rectangle on mouse drag. Here\'s my code:

-(void)drawRect:(NSRect)dirty         


        
4条回答
  •  遥遥无期
    2020-12-13 08:28

    This post is a little older but I still found no good solution (Framework) on the web. But I guess this is a task (content selection) everyone have to master someday and there is no API from Apple for it. However I made my own framework it and put on Github: https://github.com/ckteebe/MultiSelectionSuiteFramework.

提交回复
热议问题