On Oct 16, 2010, at 6:29 AM, Nick Rogers wrote:

> When I run a sheet, I want it to display a text field which has to be updated 
> every second or so (basically showing a count down "60 Seconds", "59 Seconds" 
> and so on.
> I am starting a timer in main thread using:
>       timerRawScanMsg = [NSTimer timerWithTimeInterval:1.0 target:self 
> selector:@selector(myTimerFireMethod:) userInfo:nil repeats:YES];
>       [[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg 
> forMode:NSModalPanelRunLoopMode];
>       [[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg 
> forMode:NSEventTrackingRunLoopMode];
> Then I'm starting the sheet using:
>               [NSApp beginSheet:windowRawScanMsg modalForWindow:windowMain 
> modalDelegate:self 
> didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) 
> contextInfo:nil];
> 
> The myTimerFireMethod: is not getting called, which would update the text 
> field in the sheet.

Sheets are document-modal, but are not modal windows or panels.  They are not 
processed by a modal run loop.  The run loop runs normally when a sheet is up.  
Try NSDefaultRunLoopMode.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to