> My custom NSView in a NSPanel shows some information depends on panel's
> position to the main window. I want to update it during dragging the panel.
> I try [self setNeedsDisplay:YES] in mouseDragged: delegate, drawRect: called
> many times during dragging, but it will not appear on screen until mouse stop.
> I test it on Mac OS X 10.7 and want to support 10.6.
Found the solution. Simply, drag the panel by my self. Following code in the
custom view do this.
- (void)mouseDown:(NSEvent*)event {
offset = [event locationInWindow];
}
- (void)mouseDragged:(NSEvent *)event {
NSPoint location = [NSEvent mouseLocation];
location.x -= offset;
location.y -= offset;
[[self window] setFrameOrigin:location];
[self setNeedsDisplay:YES];
}
Thanks.
Yoshiaki Katayanagi
http://www.jizoh.jp/english.html
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]