NSPopUpButton updated after the fact
NSPopUpButton updated after the fact
- Subject: NSPopUpButton updated after the fact
- From: Ryan Homer <email@hidden>
- Date: Sat, 24 Feb 2007 16:49:53 -0500
I have an NSPopUpButton that shows connection status such as online,
away, offline. While I'm establishing the connection, I want to show
"Connecting...". I do this by sending the following message (IBOutlet
NSPopUpButton *onlineStatus):
[onlineStatus setTitle:NSLocalizedStringFromTable
(@"Connecting...", ...];
Then, to connect I send the appropriate message:
[client connect ...];
But the NSPopUpButton never shows "Connecting..." during the
connection. If I don't connect, it will show "Connecting..." though
so I am thinking that this has something to do with the run loop. The
odd thing is that it used to work and I didn't notice at what point
it stopped working.
Now, during the connect phase, I do call the run loop (not sure if
this has anything to do with it, so thought I would mention it).
NSDate *limitDate = [NSDate
dateWithTimeIntervalSinceNow:RHMSNConnectionTimeout];
NSTimeInterval limitTimeInterval = [limitDate
timeIntervalSinceReferenceDate];
while(connectionStatus != RHMSNConnectionOnline
&& [NSDate timeIntervalSinceReferenceDate] < limitTimeInterval)
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
beforeDate:limitDate];
// if we were not successful, inform the delegate and reset status
if(connectionStatus != RHMSNConnectionOnline) {
[delegate ...];
...
}
What can I do to have the NSPopUpButton updated before the connection
starts?
Thanks in advance!
R
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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