• 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: Andy Lee <email@hidden>
  • Date: Fri, 22 Aug 2008 15:35:00 -0400


On Aug 22, 2008, at 3: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)?

Yes, but the OP didn't want to create the window in code. That's not so unreasonable -- I'd prefer to use IB to create the window and fill in UI components, like with any other window. You *could* create a content view in IB, create the borderless window in code, then swap in the content view. But that seems like slightly more work.


Back when I made the much-hated metallic windows a user pref, I used this approach so that I could use the same nib file to load a window and decide at runtime, depending on the user pref, whether it should be textured or not.

--Andy

_______________________________________________

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: Preventing windows from being dragged
  • Next by Date: Leopard crash in CFRunLoopAddObserver()
  • Previous by thread: Re: Preventing windows from being dragged
  • Next by thread: Re: Preventing windows from being dragged
  • Index(es):
    • Date
    • Thread