Re: Changing Texture on a Window
Re: Changing Texture on a Window
- Subject: Re: Changing Texture on a Window
- From: Marc Borer <email@hidden>
- Date: Mon, 24 May 2004 12:35:47 +0200
Hi
Thanks Bryan for the typ.
I have tryed something like this 2 methodes :
- (IBAction)textureModified:(id)sender
{
NSRect aFrame;
int mask;
int metalLookMask = (NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask);
int aquaLookMask = (NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask);
mask = ([sender state] == NSOffState) ? metalLookMask : aquaLookMask;
aFrame = [NSWindow contentRectForFrameRect:[i_mainWindow frame]
styleMask:mask];
aFrame = [NSWindow frameRectForContentRect:aFrame styleMask:mask];
[i_mainWindow setFrame:aFrame display:YES animate:NO];
}
And so :
- (IBAction)textureModified:(id)sender
{
NSWindow *win;
int mask;
int metalLookMask = (NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask);
int aquaLookMask = (NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask);
mask = ([sender state] == NSOffState) ? metalLookMask : aquaLookMask;
win = [[NSWindow alloc] initWithContentRect:[i_mainWindow
contentRectForFrameRect:[i_mainWindow frame]]
styleMask:mask
backing:[i_mainWindow backingType]
defer:NO];
i_mainWindow = win;
}
But for both case, it doesn't do anythink.
The method "textureModified" is a switch's action linked in the IB with
the Window's controller.
The Window is i_mainWindow from the NSWindow class.
Have you an idee why ?
Thank for help.
Regards
Marc
Le 23 mai 04, ` 02:50, Brian Smith a icrit :
>
Hi
>
>
In my application I switch from a transparent window to a textured
>
(brush metal) one by have my window controller create a new window
>
when the user changes the preference and in my window class it checks
>
the preferences for the change and changes the style mask which is
>
then passed to the NSWindow's subclass' designated initialization
>
method (initWithContentRect:styleMask:backing:defer:). Also, this
>
would work for changing from the textured to normal window. You should
>
be able to figure it out from the NSWindow documentation and the style
>
mask constants.
>
>
Regards,
>
>
Brian K Smith
>
President
>
SuaviWare Inc.
>
http://www.suaveware.com
>
>
On May 21, 2004, at 3:38 PM, Marc Borer wrote:
>
>
> Hi
>
>
>
> I have found the same problem in the archives list.
>
> Ben have never become an answer, that was in january 2003.
>
> Here his problem :
>
>
>
> ** Hi again,
>
> **
>
> ** is it possible to change the type of a window from brushed metal to
>
> ** aqua or vice versa programmatically during runtime?
>
> ** i can't seem to find any info on this.
>
> **
>
> ** Thanks.
>
> **
>
> ** ben
>
>
>
> Have somebody an Idee how I can resolve the problem ?
>
>
>
> Thanks
>
> Marc
>
>
>
>
>
> Le 15 mai 04, ` 15:25, Marc Borer a icrit :
>
>
>
>> Hello
>
>>
>
>> I've a window (NSWindow) with a button (NSButton).
>
>> I want to change the window texture from Normal to Metalic look
>
>> (Window Propertie "Has texture") with a click on the button, not on
>
>> the window creation.
>
>>
>
>> I'm new under MAC.
>
>> Do somebody have a solution for my problem ?
>
>> Answer in German, French and english are welcome.
>
>>
>
>> Thanks a lot
>
>> Marc
>
>>
>
>>
>
>> ---------------------------------------------------------
>
>> Powered by Apple Mail, simply the best
>
>> ---------------------------------------------------------
>
>> _______________________________________________
>
>> 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.
>
>>
>
>>
---------------------------------------------------------
Powered by Apple Mail, simply the best
---------------------------------------------------------
>
> _______________________________________________
>
> 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.
>
_______________________________________________
>
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.
_______________________________________________
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.