Dave,

On Sep 20, 2008, at 2:23 am, Dave Jewell wrote:

The code below shows how (without IB) to do this programmatically:

NSWindow * weirdWindow = [[NSWindow alloc] initWithContentRect: NSMakeRect (50, 50, 500, 300) styleMask: NSTitledWindowMask | (1 << 9) backing: NSBackingStoreBuffered defer: NO];
[weirdWindow orderFront: self];

However, as others have pointed out, it's not that simple. In the above code, for example, I've not made the window closable (no close box) 'cos if you try, the close box will end up half on and half off the vertical titlebar! Not great! If you really want to do this, and make it look good then (a) it's probably quite a bit of work and (b) you'll very likely need to give your window a custom frame class.

Tried this today and in addition to the close box being the wrong size and in the wrong position if passing NSClosableWindowMask to the styleMask it also does not become titled if you send:

        [weirdWindow setTitle:@"Window Title"];

At this point I think the only thing to do is to create a borderless window and create my own left side title bar (using +[NSWindow standardWindowButton:] to get small standard window buttons). If I manage to implement such a thing I will try to get permission to open source it.

Thanks for the fun diversion,
Nick

--
Nick Beadman
[EMAIL PROTECTED]
(sent from my mailing list account, [EMAIL PROTECTED])

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to