Fullscreen code not working (code revisions)
Fullscreen code not working (code revisions)
- Subject: Fullscreen code not working (code revisions)
- From: Rhon Fitzwater <email@hidden>
- Date: Wed, 8 Jun 2005 09:40:44 -0400
Cocoa Devs,
Since this code worked in Panther and does not work in Tiger, is this
more then just a deallocation issue. I modified the code to inlcude
the deallocation, but the program still crashes. Any help from the
cocoa side would be appreciated. Sending your revisions to the code
would be even more helpful to those who downloaded this code from
Macosxhints (this is where I got it from to add to my A.S.S. program).
My revisions are below...
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@interface NSApplication (ASKAFullScreen)
- (NSWindow *)beginFullScreen;
//- (NSWindow *)endFullScreen; //commented out because it did not
fix the crash
- (void)endFullScreen;
@end
#import "FullScreen.h"
NSWindow *fsWindow;
@implementation NSApplication (ASKAFullScreen)
- (NSWindow *)beginFullScreen
{ fsWindow = [
[NSWindow alloc]
initWithContentRect:[[NSScreen mainScreen] frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
NSView *fsView=[[NSView alloc] initWithFrame:[fsWindow frame]];
[fsWindow setContentView:fsView];
NSImageView *fsImage = [[NSImageView alloc] initWithFrame:
[fsView frame]];
[fsView addSubview:fsImage];
[fsWindow setBackgroundColor:[NSColor whiteColor]];
[NSMenu setMenuBarVisible:NO];
[fsWindow setHasShadow: NO];
[fsWindow makeKeyAndOrderFront:fsWindow];
return fsWindow;
}
//- (NSWindow *)endFullScreen;//again commented out because it did
not fix the crash
- (void) endFullScreen;
{ [NSMenu setMenuBarVisible:YES];
[fsWindow close];
[fsWindow release];
// return fsWindow; //I commented this out because it did not fix
the crash.
}
@end
Please send any revisions to the code.. I can test and get back to
the list.
Thanks in advance.
-Rhon
On Jun 7, 2005, at 12:47 PM, Jasper Van Proeyen wrote:
Tried it out myself... it crashes for me too...
To be exactly, it crashes on:
[fsWindow close];
... and I'm sure it worked on Panther!
On Jun 05, 2005, at 5:40 PM, rfitz wrote:
I have attached Fullscreen.h and Fullscreen.m below. In my ASS
code I
use these two lines to open the fullscreen window:
set theWindow to (call method "beginFullScreen")
set content view of theWindow to content view of window
"template"
Open the fullscreen window works perfect. In the fullscreen
window, I
have a button (close) which the user clicks to close the window.
When
the user clicks the close button this code is executed:
set theWindow to (call method "endFullScreen")
The fullscreen window closes, but then after about 1 or 2 seconds my
program crashes. This code worked in 10.3, but it is not working in
10.4 for some reason. Can anyone see what is going wrong here?
Any help would be appreciated.
Thanks,
-Rhon Fitzwater
_______________________________________________
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