• 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: Preventing windows from being dragged
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing windows from being dragged


  • Subject: Re: Preventing windows from being dragged
  • From: Ricky Sharp <email@hidden>
  • Date: Fri, 22 Aug 2008 16:56:13 -0500


On Aug 22, 2008, at 2:13 PM, Charles Srstka wrote:

On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote:

Creating a non-movable, non-titled window is _trivial_. Just create a tiny subclass and away you go. I do this myself, along with following the guidelines of that technote.

Why would it be necessary to make a subclass? Shouldn't it be possible to pass NSBorderlessWindowMask as the "styleMask" parameter in -[NSWindow initWithContentRect:styleMask:backing:defer:] to get a window with no title bar (which thus can't be dragged)?


I suppose depending upon your needs, you may be able to avoid a subclass.

For my stuff, my subclass provides a bit more than just an override to the designated initializer:

- Provides a mouse-moved delegate

- Overrides canBecomeKeyWindow and canBecomeMainWindow (content window always returns YES for these APIs; blanking window always returns NO)

- Accessibility overrides - to mainly route 'confirm' and 'cancel' actions to appropriate controls.

- Misc APIs that provide conveniences to my custom UI framework.


A category was not possible in my case since I needed to add ivars.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

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


References: 
 >Preventing windows from being dragged (From: Mike <email@hidden>)
 >Re: Preventing windows from being dragged (From: Jason Coco <email@hidden>)
 >Re: Preventing windows from being dragged (From: Mike <email@hidden>)
 >Re: Preventing windows from being dragged (From: Jason Coco <email@hidden>)
 >Re: Preventing windows from being dragged (From: Mike <email@hidden>)
 >Re: Preventing windows from being dragged (From: Ricky Sharp <email@hidden>)
 >Re: Preventing windows from being dragged (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: File Extensions Problem
  • Next by Date: CollectionView, PopupButton, CoreData and Bindings
  • Previous by thread: Re: Preventing windows from being dragged
  • Next by thread: Re: Preventing windows from being dragged
  • Index(es):
    • Date
    • Thread