• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fullscreen code not working (WORKAROUND)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fullscreen code not working (WORKAROUND)


  • Subject: Re: Fullscreen code not working (WORKAROUND)
  • From: Rhon Fitzwater <email@hidden>
  • Date: Sat, 11 Jun 2005 23:33:10 -0400

Jasper,

I was able to find a workaround to this bug.  I am still hoping my messages sent to the cocoa dev lists results in a reason for the crash.  Anyway,  I just replaced the [fsWindow close]; line of code with [fsWindow orderOut:nil];

This will hide the window instead of closing it.  My program no longer crashes!  Let me know if it fixes your crashing with the code as well.

Regards,

-Rhon Fitzwater

Fixed Code:

- (void)endFullScreen;
{   [NSMenu setMenuBarVisible:YES];
    [fsWindow orderOut:nil];//closing the window caused the crash, so why not just hide it!
}

On Jun 8, 2005, at 3:17 AM, Jasper Van Proeyen wrote:

Sorry... same problem here... Cocoa help would be highly appreciated :-(

Jasper.

On Jun 07, 2005, at 9:18 PM, Rhon Fitzwater wrote:

Any idea on how we can get this working again.

-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

#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]
                               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:0];
       [fsWindow setHasShadow: NO];

   [fsWindow makeKeyAndOrderFront:fsWindow];
   return fsWindow;
}
- (void)endFullScreen
{   [NSMenu setMenuBarVisible:1];

   [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

  • Prev by Date: Re: alloc ... initWith ... malloc and NSObject
  • Next by Date: Zerolink and undefined symbol _main
  • Previous by thread: Re: alloc ... initWith ... malloc and NSObject
  • Next by thread: Zerolink and undefined symbol _main
  • Index(es):
    • Date
    • Thread