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

Stop dragging my <NSWindow> around


  • Subject: Stop dragging my <NSWindow> around
  • From: Ken Tabb <email@hidden>
  • Date: Thu, 3 Feb 2005 13:32:31 +0000

... 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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Stop dragging my <NSWindow> around
      • From: Dietmar Planitzer <email@hidden>
    • Re: Stop dragging my <NSWindow> around
      • From: Edward Hillenbrand <email@hidden>
    • Re: Stop dragging my <NSWindow> around
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: Method not seeing array as array
  • Next by Date: Re: Method not seeing array as array
  • Previous by thread: Re: String not showing up in Table
  • Next by thread: Re: Stop dragging my <NSWindow> around
  • Index(es):
    • Date
    • Thread