Re: changing the style mask of an NSWindow
Re: changing the style mask of an NSWindow
- Subject: Re: changing the style mask of an NSWindow
- From: Rakesh Pandey <email@hidden>
- Date: Wed, 29 Jan 2003 07:04:52 -0800
Create a subclass of NSWindow and drag the header for this class into
your nib file and set the custom class for your window as this new
class.
I have doen the same for my app and here is the code for subclass.
#import <Cocoa/Cocoa.h>
@interface Toolbar: NSWindow {
}
@end
#import "Toolbar.h"
@implementation Toolbar
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag{
self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:(NSBackingStoreType)backingType defer:YES];
[self setFloatingPanel:YES];
[self setHasShadow:YES];
return self;
}
-(BOOL)canBecomeKeyWindow
{
return YES;
}
-(void)dealloc
{
[super dealloc];
}
@end
On Wednesday, January 29, 2003, at 06:24 AM, Damien wrote:
>
> On Wednesday, Jan 29, 2003, at 10:52 Europe/Stockholm, Damien wrote:
>
>
>
>> I have a normal NSWindow and I want to change it in a window that
>
>> has no title bar.
>
>> Is it possible programmatically? I mean ... without creating another
>
>> NSWindow in which I would copy the content of the original window.
>
> No, you can only set the style mask of a window when you create it,
>
> not dynamically (it's in the documentation).
>
>
Ok.
>
My window is a window built in Interface Builder, how can I change the
>
style mask of this window?
>
There's no method such as initWithWindowNibName:withStyleMask or
>
something in NSWindowController. And it seems that I can't do that in
>
IB because I don't see any option to remove the title bar (I can
>
remove miniaturize, close, and resize controls, but that's not enough)
>
>
So the only solution I see is to create a new NSWindow with
>
initWithContentRect:styleMask and then move the contentView from the
>
nib window to the new one (with setContentView). But I don't want that
>
solution :) I HAVE to use the original nib window. Is that possible?
>
>
damien
>
_______________________________________________
>
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.
>
Rakesh Pandey
------------------------------------------------------------------------
--------
Windows) 98 (n) - 32-bit extensions and graphical shell
for a 16-bit patch to an 8-bit operating system
originally coded for a 4-bit microprocessor
written by a 2-bit company
that can't stand 1 bit of competition.
_______________________________________________
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.