• 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
Round view on "move by background" window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Round view on "move by background" window


  • Subject: Round view on "move by background" window
  • From: glenn andreas <email@hidden>
  • Date: Fri, 21 Mar 2008 15:52:49 -0500

I've got a window that can be moved by clicking on the background (it's irregularly shape, so it doesn't have a title bar). In that window is a view which is basically circular (not opaque, only draws and responds to a circular area in the middle of the view). The problem is that this results in "dead spots" in the corners of that view where I'd expect to be able to drag the window (like I can everywhere else in the background).

The view returns NO for -isOpaque, and NO for -mouseDownCanMoveWindow (since it needs to be able to track and respond to clicks in the content). In order to handle the fact that the view is non-square, I've implemented -hitTest: to see if the mouse is in the circular "live" area, and return the view, and return nil for things outside that (which results in the super-views hitTest routine to return the superview).

I've even overridden the window's content view to determine that it's hitTest: properly returns the content view when the user clicks on the corner of the round view.

Nothing I've tried, however, allows the user to actually drag the window while clicking in the corners of the round view. It's almost as if the "can move window by background" logic goes by bounding boxes only and doesn't actually call hitTest to determine what is clicked on (to see whose -mouseDownCanMoveWindow it should pay attention to). Everywhere else in the window, dragging works exactly as expected (so the window's isMovableByWindowBackgound works correctly), but just not those four corners.

Short of having the window's content view return NO for its mouseDownCanMoveWindow and then add window moving to the mouseDown/ mouseDragged routines (which seems ugly at best), is there something I'm missing?


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build, mutate, evolve, animate




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Best Way To Lookup From a Huge Table
  • Next by Date: Re: Best Way To Lookup From a Huge Table
  • Previous by thread: Re: NIB files on 10.1
  • Next by thread: dealloc methods not being called?
  • Index(es):
    • Date
    • Thread