Re: Why is a button in a window not redrawn when I change its state?
Re: Why is a button in a window not redrawn when I change its state?
- Subject: Re: Why is a button in a window not redrawn when I change its state?
- From: Jens Alfke <email@hidden>
- Date: Mon, 04 Jul 2011 11:38:06 -0700
On Jul 4, 2011, at 8:07 AM, Ulf Dunkel wrote:
> 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?
That should work; in fact, you don’t even need the -setNeedsDisplay: call.
- Is this method being called when you expect? Set a breakpoint in it, or add an NSLog call.
- Is killHelpdButton set to the right value, e.g. non-nil?
- Are you calling this on a background thread? In general you should only call AppKit from the main thread.
—Jens_______________________________________________
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