Modal Window with dynamic nstextfield
Modal Window with dynamic nstextfield
- Subject: Modal Window with dynamic nstextfield
- From: Jeremy Matthews <email@hidden>
- Date: Mon, 05 Apr 2010 13:15:42 -0400
I have a modal window with code to update both a progress bar and corresponding text...the progress bar gets updated just fine but the textfield never does (except if I re-run the method the last string I pushed to the textfield from the previous run does appear).My understanding was that if you ran a modal session you could still interact with the UI to display changes...let me know what I'm missing here. I created a simple run loop to detail my issue.
[NSApp beginSheet: progressWindow
modalForWindow: mainWindow
modalDelegate: self
didEndSelector: nil
contextInfo: nil];
NSModalSession session = [NSApp beginModalSessionForWindow:progressWindow];
[progressIndicator displayIfNeeded];
[progressIndicator setDoubleValue:0.0];
[NSApp runModalSession:session];
int mmm;
for (mmm=0;mmm<150;mmm++)
{
[progressIndicator displayIfNeeded];
[progressIndicator setDoubleValue:mmm];
NSString *temp222 = [NSString stringWithFormat:@"%d",mmm];
NSLog(@"string value is %d",mmm);
[statusText setStringValue:temp222];
}
NSDate *future2 = [NSDate dateWithTimeIntervalSinceNow:2];
[NSThread sleepUntilDate:future2];
[NSApp endModalSession:session];
[progressWindow orderOut:self];
[NSApp endSheet:progressWindow];
Thanks,
jeremy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden