• 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: Stop dragging my <NSWindow> around
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stop dragging my <NSWindow> around


  • Subject: Re: Stop dragging my <NSWindow> around
  • From: Ken Tabb <email@hidden>
  • Date: Thu, 3 Feb 2005 18:05:36 +0000


On 3 Feb 2005, at 4:43 pm, Matt Neuburg wrote:

On Thu, 3 Feb 2005 13:32:31 +0000, Ken Tabb <email@hidden> said:

I'm still trying to implement window snap-to-edge functionality with my
panels (further to my "mouseDown/Up on window's titlebar?" post).
Although the window doesn't get mouseDown / mouseUp called by default
when you click / release the titlebar, overriding your window's
-sendEvent: allows you to catch all mouseDowns / mouseUps.

I don't know if this will help, but what I do is eliminate the title bar.
Now I *do* get mouseDown / Up, because the user is actually dragging in the
content area. My implementation is not quite the same as what you want; I
simply permit the drag, then correct the position at the end, when the mouse
goes up. It is necessary to use "delayed performance" to do this:


[self performSelector:@selector(fixPosition) withObject:nil afterDelay:0.1];

Hi Matt,

thanks for the ideas; your solution sounds similar to the Irate Scotsman code, in theory at least.

For the windows of the app in question I need titlebars, and I'd rather use proper ones if possible. As I say I've managed to get past the mouseDown / mouseUp issues, so I'm getting them fine. But during a drag, there's something else moving my window besides me.

Granted having a false titlebar might prevent something else from trying to intercept dragging of the titlebar (unless the phantom is using notifications, in which case my window is still sending notifications that it has moved / is being moved), but with your method do you not get a judder, caused by your code 'correcting' the user dragged position of the window? I'm really after something that doesn't judder (like the Irate Scotsman code) _and_ has titlebars to drag the window around, instead of faux-titlebars. I really can't believe it's so difficult to work around in Cocoa 8^(

Out of interest why do you need the delayed performance? Doesn't the correction get called after the drag is over anyway, without the 0.1 offset? Or maybe I'm missing the entire point of your message, in which case oops sorry!

Cheers,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/

Certified non-Microsoft Solution Provider

_______________________________________________
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


References: 
 >Re: Stop dragging my <NSWindow> around (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Stop dragging my <NSWindow> around
  • Next by Date: Re: Stop dragging my <NSWindow> around
  • Previous by thread: Re: Stop dragging my <NSWindow> around
  • Next by thread: Re: Stop dragging my <NSWindow> around
  • Index(es):
    • Date
    • Thread