• 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: run loop problem (i think)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run loop problem (i think)


  • Subject: Re: run loop problem (i think)
  • From: "Ken Victor" <email@hidden>
  • Date: Fri, 13 May 2005 11:20:30 -0700

bob,
thanx for the reply. unfortunately it didn't solve my problem. however and for the archives i found a solution/workaround: i post a mouse down event to the modal window and everything works fine now.


thanx,
ken


At 8:17 PM -0400 5/12/05, Bob Ippolito wrote:
On May 11, 2005, at 6:29 PM, Ken Victor wrote:




given the following (summary)in my main thread:

[NSThread detachNewThreadSelector: @selector(doSteps:)
        toTarget: self
        withObject: nil];
[NSApp runModalForWindow: [controller window]];

and

- (void) doSteps: (id) unused {
    NSAutoreleasePool* arp = [[NSAutoreleasePool alloc] init];
    ...
    [NSApp performSelectorOnMainThread: @selector(stopModal)
            withObject: nil
            waitUntilDone: NO];
    [arp release];
    }

ie, i start a thread and then run a modal window. the last thing my thread does before returning is to call NSApp stopModal (and then releases its aur release pool).

the problem is that my code following the call to runModalForWindow doesn't execute until i click the mouse or type a key on the keyboard.

(note that i've tried calling stopModal directly in my thread as opposed to via performSelectorOnMainThread and it doesn't solve the problem. i've also unsuccessfully tried pass YES as the waitUntilDone argument.)

can anyone give me any ideas as to what is causing this behavior, or more importantly how i can avoid it?




It might be running in a different mode (probably NSModalPanelRunLoopMode) when you have a modal run loop up, try using performSelectorOnMainThread:withObject:waitUntilDone:modes: instead and specify [NSArray arrayWithObjects: NSModalPanelRunLoopMode, NSDefaultRunLoopMode, nil] for the modes and see if that helps.


-bob


_______________________________________________
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


References: 
 >run loop problem (i think) (From: Ken Victor <email@hidden>)
 >Re: run loop problem (i think) (From: Bob Ippolito <email@hidden>)

  • Prev by Date: Re: Where/how to store lots of user application data
  • Next by Date: Re: Where/how to store lots of user application data
  • Previous by thread: Re: run loop problem (i think)
  • Next by thread: NSRunAlertPanel with checkbox?
  • Index(es):
    • Date
    • Thread