Re: how to make an NSWindow unmovable...
Re: how to make an NSWindow unmovable...
- Subject: Re: how to make an NSWindow unmovable...
- From: Craig Hunter <email@hidden>
- Date: Sun, 12 Jun 2005 22:26:42 -0400
> Date: Sun, 12 Jun 2005 15:04:05 -0700
> From: Jeff Ganyard <email@hidden>
> Subject: Re: how to make an NSWindow unmovable...
> To: Philip George <email@hidden>
> Cc: cocoa Dev <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>> note that if i just use NSTexturedBackgroundWindowMask, and then
>> call [window setMovableByWindowBackground:NO], since there is no
>> titlebar it's 100% content area, and thus cannot be moved at
>> all.... which is great...
>>
>> ...but i need the rounded corners too. :(
>
> Create a blank window the way you want (size, rounded corners, etc),
> capture it and use that as an image in a clear window without a title
> bar. Basically create your own window background. The round
> transparent window sample should have everything you need.
Yeah, that's my suggestion -- make a transparent window without title bar,
stick an image view in the window, and then load your own custom splash
screen image (created from screen grab, PhotoShop, whatever) into the image
view.
For example:
/* TransparentWindow */
#import <Cocoa/Cocoa.h>
@interface TransparentWindow : NSWindow
{
}
@end
--
#import "TransparentWindow.h"
@implementation TransparentWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle
backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
NSWindow *result = [[NSWindow alloc] initWithContentRect:contentRect
styleMask: NSBorderlessWindowMask backing:bufferingType defer:flag];
[result setBackgroundColor:[NSColor clearColor]];
[result setHasShadow:YES];
[result setOpaque:NO];
return result;
}
@end
--
Dr. Craig A. Hunter
NASA Langley Research Center
AAAC / Configuration Aerodynamics Branch
(757) 864-3020
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden