• 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
Need HELP - Dragging a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need HELP - Dragging a view


  • Subject: Need HELP - Dragging a view
  • From: "" <email@hidden>
  • Date: Thu, 2 Mar 2006 02:34:17 -0500 (EST)

Hello!

I did a little app with a view that holds a subview.
My problem is to drag that subview around in its superview,
but it is SLOW!

I tried also to draw both the subview and the superview contents
using Quartz (in the -drawRect: methods), but with no success.

Any suggestion?

Thanks for any answer.
David.

My code in the subview implementation file

- (void)mouseDown:(NSEvent *)theEvent
{
        	NSPoint event_location = [theEvent locationInWindow];
	NSPoint local_point = [self convertPoint:event_location fromView:nil];

	dx = local_point.x;
	dy = local_point.y;
}

- (void)mouseDragged:(NSEvent *)theEvent
{
	MainView *mainView;
	mainView = (MainView *)[self superview];

	NSPoint event_location = [theEvent locationInWindow];
	NSPoint local_point = [[self superview] convertPoint:event_location fromView:nil];

	NSPoint origin;
	origin.x = local_point.x - dx;
	origin.y = local_point.y - dy;
	[self setFrameOrigin:origin];

	[self autoscroll:theEvent];

	[mainView setNeedsDisplay:YES];
}



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Need HELP - Dragging a view
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Bizarre problems and ahs_main()
  • Next by Date: Re: vCard -> loss of Identity
  • Previous by thread: Re: vCard -> loss of Identity
  • Next by thread: Re: Need HELP - Dragging a view
  • Index(es):
    • Date
    • Thread