Re: Utility/Floating window with titlebar on left side
Re: Utility/Floating window with titlebar on left side
- Subject: Re: Utility/Floating window with titlebar on left side
- From: Nick Beadman <email@hidden>
- Date: Mon, 22 Sep 2008 12:03:32 -0700
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@hidden
(sent from my mailing list account, email@hidden)
_______________________________________________
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