Re: Fullscreen code not working
Re: Fullscreen code not working
- Subject: Re: Fullscreen code not working
- From: Ian was here <email@hidden>
- Date: Sun, 5 Jun 2005 10:42:06 -0700 (PDT)
Some minor issues here...
--- rfitz <email@hidden> 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
>
> #import <Foundation/Foundation.h>
> #import <AppKit/AppKit.h>
> @interface NSApplication (ASKAFullScreen)
> - (NSWindow *)beginFullScreen;
> - (void)endFullScreen;
> @end
>
>
> #import "FullScreen.h"
> NSWindow *fsWindow;
> @implementation NSApplication (ASKAFullScreen)
> - (NSWindow *)beginFullScreen
> { fsWindow = [
> [NSWindow alloc]
> initWithContentRect:[[NSScreen mainScreen]
> frame]
Might be better to say:
- (NSWindow *)beginFullScreen
{ fsWindow = [[NSWindow alloc]
initWithContentRect:[[NSScreen screens]
objectAtIndex:0] frame] ;
>
> styleMask:NSBorderlessWindowMask
>
> backing:NSBackingStoreBuffered
> defer:NO];
> NSView *fsView=[[NSView alloc]
> initWithFrame:[fsWindow frame]];
If the view is to be attached to the window, then you
must use the windows coordinates.
NSSize winSize = [fsWindow frame].size;
NSView *fsView=[[NSView alloc]
initWithFrame:NSMakeRect( 0.0, 0.0, winSize.width,
winSize.height )];
> [fsWindow setContentView:fsView];
> NSImageView *fsImage = [[NSImageView alloc]
> initWithFrame:[fsView frame]];
> [fsView addSubview:fsImage];
> [fsWindow setBackgroundColor:[NSColor
> whiteColor]];
> [NSMenu setMenuBarVisible:0];
[NSMenu setMenuBarVisible:NO];
> [fsWindow setHasShadow: NO];
>
> [fsWindow makeKeyAndOrderFront:fsWindow];
> return fsWindow;
> }
> - (void)endFullScreen
> { [NSMenu setMenuBarVisible:1];
[NSMenu setMenuBarVisible:YES];
>
> [fsWindow close];
> }
> @end
> _______________________________________________
> 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
>
Hope this helps.
Ian
__________________________________
Discover Yahoo!
Use Yahoo! to plan a weekend, have fun online and more. Check it out!
http://discover.yahoo.com/
_______________________________________________
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