From fe2599eb351838ebf8a5476059093795aa2cde82 Mon Sep 17 00:00:00 2001 From: luddep Date: Wed, 6 Jan 2010 05:48:59 +0100 Subject: [PATCH] buttons now momentarily go the the pressed state when clicked programmatically. Closes #187 --- AppKit/CPControl.j | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppKit/CPControl.j b/AppKit/CPControl.j index 54208bf92..ad81ba7d3 100644 --- a/AppKit/CPControl.j +++ b/AppKit/CPControl.j @@ -308,6 +308,12 @@ var CPControlBlackColor = [CPColor blackColor]; [self highlight:YES]; [self setState:[self nextState]]; [self sendAction:[self action] to:[self target]]; + + [CPTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(unhighlightButtonTimerDidFinish:) userInfo:nil repeats:NO]; +} + +- (void)unhighlightButtonTimerDidFinish:(id)sender +{ [self highlight:NO]; }