• 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
NSWindow orderOut: causing a crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWindow orderOut: causing a crash?


  • Subject: NSWindow orderOut: causing a crash?
  • From: "Douglas A. Welton" <email@hidden>
  • Date: Wed, 12 Jan 2005 21:20:08 -0500

Hi All,

Apologies for the length of this message, but I wanted to include a couple
of pieces of code to illustrate the problem...

Basically, I want to toggle a window between being visible and not visible.

My application has two windows, each containing an NSMovieView subclass.
The user does their set-up work using the Main_Window (which contains
Preview_MovieView) and can do their playback using Fullscreen_Window (which
contains Fullscreen_MovieView).  I have an additional pointer
Acitve_MovieView which always points to the current NSMovieView.

If the user presses the Play button the following code is executed:

    if ( Fullscreen_Enabled )
       {
         Active_MovieView = Fullscreen_MovieView;
         [self Setup_MovieView_Playlist_Attributes];
         [self Setup_MovieView_Clip_Attributes];
         [Fullscreen_Window makeKeyAndOrderFront: self];
         }

If the user presses the Stop button the following code is executed:

    if ( Fullscreen_Enabled )
       {
         [Fullscreen_Window orderOut: sender];
         Active_MovieView = Preview_MovieView;
         [Active_MovieView setMovie: [Current_Clip Cocoa_Movie]];
         [Active_MovieView display];
         }

After starting the application, I set Fullscreen_Enabled to TRUE and I press
the Play button.  This works fine.  I see the Fullscreen_Window.  I press
the Stop button.  The Fullscreen_Window disappears.  Life is good so far.
However, when I press the Play button again, I get the following error
messages:

2005-01-12 20:30:10.372 FrameVault[6043] *** Assertion failure in
-[Oak_MovieView lockFocus], AppKit.subproj/NSView.m:2746
2005-01-12 19:37:31.405 FrameVault[6038] lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform window

The Fullscreen_Window is a borderless window created with the defer:
parameter set to "NO". (the "defer" checkbox is uncheck in IB as well)

I can make the error go away by changing the following line in the Stop
button's code:

         [Fullscreen_Window orderOut: sender];
   to
         [Fullscreen_Window orderBack: sender];

Unfortunately, this doesn't produce the visual effect I want.

Does anyone see an obvious error on my part?  I have used the
orderOut:/makeKeyAndOrderFront: pairing in a number of projects and never
had this problem before.  Any/all suggestions are welcome.

thanks,

douglas

 _______________________________________________
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

  • Follow-Ups:
    • Re: NSWindow orderOut: causing a crash?
      • From: Rudi Sherry <email@hidden>
  • Prev by Date: How do you set an image's background color to CLEAR?
  • Next by Date: Re: NSTableView using bindings for its content can't be a drag source?
  • Previous by thread: Re: How do you set an image's background color to CLEAR?
  • Next by thread: Re: NSWindow orderOut: causing a crash?
  • Index(es):
    • Date
    • Thread