• 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: I need more mouseDragged events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I need more mouseDragged events


  • Subject: Re: I need more mouseDragged events
  • From: Bertrand Landry-Hétu <email@hidden>
  • Date: Thu, 8 Apr 2004 17:40:01 -0700

Hi,

I don't know if there is a "good" Cocoa way of doing that, but i know that some commercial drawing software have a low level timer that queries the mouse location when the user does a mouse down on the drawing canvas. Cumulating the data in a queue that the main event loop processes when it has time to do so. Depending on the resolution of the timer you'll get better results. I think the best you can get is one of the low level timer that gets called at interrupt time (whatever it means nowadays in OS X), or maybe having a thread to do the work... It gets a bit more complicating if you want to get tablet support :).

Bert!

On 08 avr. 2004, at 17:22, M. Uli Kusterer wrote:

Hi,

is there a way to get mouseDragged: events for an NSView more frequently? I'm implementing drawing tools, and my brush drawings look more like Polygons. I vaguely remember that someone had this problem before on the list, but I just can't find the messages in the archives anymore. Here's what I have tried so far:

1) Optimized my drawing code so it honors and invalidates only the rects that actually changed, thinking my drawing was taking too long.

2) Registered a tracking region for my NSView. Zilch improvement.

3) Changed my code to call NSApp's getNextEvent: in a tight loop in NSTrackingRunloopMode, processing only mouseDragged and mouseUp events. Didn't improve anything either.

Should one of these have done it? Has anyone got this working and can tell me what worked for them? Any sample code anywhere so I can check where I went wrong?

And if nobody has a clue, anyone know where among Apple's Dev Tools I can find a simple, usable profiler that just runs my app and tells me how much time it spent on average, longest and shortest in a certain method, or in a function called from it? I don't need anything nifty, just something like good ol' Metrowerks Profiler...
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.
_______________________________________________
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: I need more mouseDragged events
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >I need more mouseDragged events (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Setting env vars from Cocoa with /bin/sh?
  • Next by Date: Re: Setting env vars from Cocoa with /bin/sh?
  • Previous by thread: I need more mouseDragged events
  • Next by thread: Re: I need more mouseDragged events
  • Index(es):
    • Date
    • Thread