ビューベースの NSTableview のドラッグ アンド ドロップについていくつか質問があります。
- ドラッグ アンド ドロップのハイライト色を変更するには?
- ドラッグ アンド ドロップの長方形の形状 (幅と高さ) を変更するには?
前もって感謝します
ビューベースの NSTableview のドラッグ アンド ドロップについていくつか質問があります。
前もって感謝します
NSTableRowView
サブクラスで次のようなことができるはずです。
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (!self)
return nil;
// etc...
[self setDraggingDestinationFeedbackStyle:NSTableViewDraggingDestinationFeedbackStyleNone];
return self;
}
- (void)drawDraggingDestinationFeedbackInRect:(NSRect)dirtyRect {
NSRect drawRect = [self bounds];
// Tweaking the size of the drawing rectangle...
aRowRect.size.height--;
aRowRect.size.width-=2;
aRowRect.origin.x++;
NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRect:drawRect];
[[NSColor redColor] set];
[backgroundPath fill];
[[NSColor greenColor] set];
[backgroundPath stroke];
}
もちろん、クリスマスをテーマにしたアプリを作成していない場合は、これらの色を変更する必要があります。