• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dragging Rect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Dragging Rect
      • From: John Haney <email@hidden>
  • Prev by Date: Re: C question for you old guys ;-)
  • Next by Date: Re: troubling article : a few real argument of my own.
  • Previous by thread: Re: Dragging Rect
  • Next by thread: Re: Dragging Rect
  • Index(es):
    • Date
    • Thread