Re: Dragging Rect
Re: Dragging Rect
- Subject: Re: Dragging Rect
- From: Lorenzo <email@hidden>
- Date: Wed, 11 Jun 2003 20:25:48 +0200
Hi,
maybe I didn't understand well.
I override the -display method this way:
- (void)display
{
[self lockFocus];
if(isDragging){
NSLog(@"isDragging");
[[NSColor selectedControlColor] set];
NSFrameRect(dragRect);
}
[super display];
[self unlockFocus];
}
I can see the log string "isDragging", so I am sure the 2 statements
[[NSColor selectedControlColor] set];
NSFrameRect(dragRect);
should be executed, but my application doesn't draw anything.
I presume these statements can work only within the drawRect methods.
Also I modified the mouseDragged method adding [self display];
otherwise the display method would never been invoked.
//////////////////////////////////////////
- (void)mouseDragged:(NSEvent *)theEvent
{
isDragging = YES;
currentLocation = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
dragRect = MYRectFromPoints(initialLocation, currentLocation);
[self display];
}
I am not sure about what I did, but I cannot see any dragging rectangle.
Can you tell me more please?
Best Regards
--
Lorenzo
email: email@hidden
>
From: John Haney <email@hidden>
>
Date: Wed, 11 Jun 2003 10:21:04 -0700 (PDT)
>
To: Lorenzo <email@hidden>
>
Subject: Re: Dragging Rect
>
>
[super
>
display]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.