In my app's main window, I have a button which should kill a process from the running system processes. (Guess what - it is helpd.)

In -awakeFromNib:, a private app delegate method -checkHelpd: checks if some other app has already launched helpd. If so, the button will be drawn as enabled, else disabled.

When I press the button, another private method -killHelpd: definitely kills the process, then -checkHelpd: is used again to check whether the button's state should be disabled or enabled. This triggers a redraw of the window - or at least should do. But the button is not redrawn (with its new state) until I toggle the active app from my app to say Xcode and back to my app.

This is the method in my AppDelegate.m which should update the button:

- (void)updateKillHelpdButton
{
   [killHelpdButton setEnabled:[self checkHelpd]];
   [killHelpdButton setNeedsDisplay:YES];
}

Can someone please tell me what else I should do to force the redraw?

Thank you in advance,
---Ulf Dunkel
_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to