• 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: Window Styles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window Styles


  • Subject: Re: Window Styles
  • From: Jeremy Dronfield <email@hidden>
  • Date: Sat, 15 May 2004 09:57:18 +0100

On 15 May 2004, at 9:15 am, Mark Thomas wrote:

1) How can can you get another another window style for a window in IB
???,
"Window style"? Not sure whether you mean Brushed Metal or just
altering the attributes, but both may be found in the inspector.

I was trying to do a plain window style, but I always end up with the
title bar being there. Unless I have missed something.

What you're referring to as plain is called a "borderless" window, and you can't do it in IB. Instead, create your window as normal in IB, then subclass NSWindow and set your window's Custom Class to your subclass. In the subclass's implementation file, initialise the window like so:

- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {

if (self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask // this is the important bit
backing:NSBackingStoreBuffered
defer:NO]) {

return self;
}

return nil;
}

If you want your borderless window to be able to receive keyboard events, you will also want to override:

- (BOOL) canBecomeKeyWindow {
return YES;
}

Hope this helps.

Regards,
-Jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • IB calling init of AppKit subclass [was Re: Window Styles]
      • From: Brent Gulanowski <email@hidden>
    • Re: Window Styles
      • From: j o a r <email@hidden>
References: 
 >Re: Window Styles (From: Mark Thomas <email@hidden>)

  • Prev by Date: Re: Window Styles
  • Next by Date: Re: Window Styles
  • Previous by thread: Re: Window Styles
  • Next by thread: Re: Window Styles
  • Index(es):
    • Date
    • Thread