Re: Fullscreen code not working (code revisions)
Re: Fullscreen code not working (code revisions)
- Subject: Re: Fullscreen code not working (code revisions)
- From: Rhon Fitzwater <email@hidden>
- Date: Sat, 11 Jun 2005 11:29:25 -0400
I have not gotten any responses from the list yet. Does anyone have
any ideas why the code below is crashing my program when the
fullscreen window is closed? If you see errors or think something
should be changed in the code, please revise it and resubmit to the
list. I got this code from MacOSXHints.com. It worked in Panther,
but stopped working in Tiger. Since I did not develop the code, and
am out of my cocoa knowledge when it comes to figuring out what is
going wrong, I am hoping I can rely on this list for help. You will
not only be helping me, but all of the other users who use this code
in their A.S.S project.
Thanks in advance,
-Rhon Fitzwater
On Jun 8, 2005, at 9:40 AM, Rhon Fitzwater wrote:
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:
40gmail.com
This email sent to 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