• 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:09:22 +0000

Hi Mark,

thanks for the link. I've seen the code but it 'cheats' (no offence to Matt Gemmell) by not using titlebars in the windows... he has a borderless window that has a false titlebar (he's quite up front about it; it doesn't look anything like a normal Aqua window titlebar). It seems that when you drag using the window's contentView, it works fine and you are in sole control of window dragging (as per the code you reference) but that when you drag using the titlebar, you're not the only one driving the bus. And furthermore you don't know how to ask the other driver to please stop.

Thanks for the idea anyway!
Ken

On 3 Feb 2005, at 2:55 pm, Mark Munz wrote:

Ken,

I ran across this a while back:

<http://iratescotsman.com/products/source/>

there's a snapping window sample that may be what you want (or at least tell you what you need to know).

Mark Munz

On Feb 3, 2005, at 7:32 AM, Ken Tabb wrote:

... to hijack a Stevie Nicks song title...

Hi folks,

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.

So in my event loop I am filtering out mouseDragged events. For every other type of event I call [super sendEvent:], but I do not call super for mouseDragged. On a mouseDragged event in my event loop, no code runs at all (not even the 'default' section of the switch).

My aim is to prevent the window from being dragged automatically by the OS / Window Server / Cocoa... I want complete control of where the window is being moved. Otherwise, you get the OS doing its thing, then your code doing your thing (or vice versa), resulting in juddery movement during each stage of a drag. So at the moment I'm trying to prevent my window from being moved automatically during a drag. Once I know the window is stationary I can go about adding code to move it appropriately, in the knowledge that nothing else is interfering.

However, despite trying to block all attempts by Cocoa to move my window around when I drag on the titlebar, it's still moving happily around the screen (as per a normal panel when you drag the titlebar).

It's definitely not my event loop doing it, and my notification methods are all blank (and not calling [super makeHimGoMad] etc.), so does anyone know what it is that's causing the window to move around? I'm guessing the window server, but if this is the case, how do I go about tell it to leave off my window?

Please tell me if I'm barking up the wrong tree!

Ken

p.s. it's my intention to upload the source code when I get window-snapping working. And maybe an accompanying book...

- - - - - - - - - -
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:
email@hidden


This email sent to email@hidden





- - - - - - - - - -
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: 
 >Stop dragging my <NSWindow> around (From: Ken Tabb <email@hidden>)

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