Re: Dragging Rect
Re: Dragging Rect
- Subject: Re: Dragging Rect
- From: John Haney <email@hidden>
- Date: Wed, 11 Jun 2003 11:44:40 -0700 (PDT)
Lorenzo,
Time for Disclaimers: I don't consider myself an
expert and also I'm not on a mac now, so I'm trying to
help you with what resources I have...
Hopefully someone who has more experience messing with
drawing views can chime in with a fuller description.
Here's the next step (in my opinion) from your code
now... see the comments mixed in with your last
post...
--- Lorenzo <email@hidden> wrote:
>
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];
>
}
Try this instead...
- (void)display
{
[super display];
if(isDragging){
NSLog(@"isDragging");
[self lockFocus];
[[NSColor selectedControlColor] set];
NSFrameRect(dragRect);
[self unlockFocus];
}
}
>
Also I modified the mouseDragged method adding [self
>
display];
>
otherwise the display method would never been
>
invoked.
You should call setNeedsDisplay: instead...
[self setNeedsDisplay:YES];
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
_______________________________________________
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.