Hi Jens.
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
PS: I am quite sure that there is no official API for what I am doing
here, so I fear there's no other nice way of checking if helpd has been
launched. I could get rid of this all if I'd cover the relevant button
in a sheet which isn't visible all the time, but I'd like to keep it in
the main
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,
Your Button has to draw itself after it called its action.
You try to change state while you are still in the action.
Did you try to performSelector after 0.0?
Am 04.07.2011 um 17:07 schrieb Ulf Dunkel:
In my app's main window, I have a button which should kill a process from the
running
Thank you for this hint, Alexander. I wasn't aware that I was still
inside the action and that the poor button couldn't do then what I asked
it to do.
I was quite sure that using -setNeedsDisplay:YES would trigger some
auto-redraw stuff somewhen later in the application.
- - - - -
Am
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
On Jul 4, 2011, at 10:48 AM, Ulf Dunkel wrote:
Thank you for this hint, Alexander. I wasn't aware that I was still inside
the action and that the poor button couldn't do then what I asked it to do.
It’s OK to call -setEnabled: during a button action method. I’ve done it a lot.