• 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: Self terminating popup window - need help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Self terminating popup window - need help


  • Subject: Re: Self terminating popup window - need help
  • From: "Joshua D. Orr" <email@hidden>
  • Date: Thu, 14 Apr 2005 16:33:54 -0600

I am guessing you are using a NSTimer.  Your new thread probably does not have
a message run loop running, and NSTimer makes use of that.

Quoting Dan Yocom <email@hidden>:

Hi,
  I created a subclass of NSWindow that automatically closes the
window after three seconds. The subclass works as it should when
called from a normal objective-C routine/function. However, if I call
it from within a NSThread I create, it will popup but not close. Does
anyone know why it won't work porpperly when call from within an
NSThread?




---------------------------------- Custom NSWindow class --------------------------------

- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{

	NSWindow* result = [super initWithContentRect:contentRect
styleMask:aStyle backing:NSBackingStoreBuffered defer:NO];
   [result setLevel: NSStatusWindowLevel];

   [self performSelector:@selector(closeSplashScreenPanel)
withObject:nil afterDelay:3];

   return result;
}

- (void)closeSplashScreenPanel
{
[self release];
}

---------------------------------- NSThread Stuff
---------------------------------------------
[NSThread detachNewThreadSelector: @selector(MyThread) toTarget:self
withObject:nil];

- (void)MyThread
{
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];


//Programatically Create and display window here //in my actuall program I have a hole bunch of stuff running in a while loop


[pool release];

}

Any help would be great,
                                    Dan Yocom
_______________________________________________
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



_______________________________________________
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: Self terminating popup window - need help
      • From: j o a r <email@hidden>
References: 
 >Self terminating popup window - need help (From: Dan Yocom <email@hidden>)

  • Prev by Date: Re: Cocoa from C++ (dont want to mix it)
  • Next by Date: Newbie Question: Building an application for multiple machines
  • Previous by thread: Self terminating popup window - need help
  • Next by thread: Re: Self terminating popup window - need help
  • Index(es):
    • Date
    • Thread