summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-02 13:15:38 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-02 13:18:16 (GMT)
commit475cec615cda74aa34d9519239e2f627256ef71d (patch)
treef70c4d7ffb221eefd2b31a38ff1b948ad0faab1a /Slimber/Cocoa/CocoaAction.mm
parent04d48741240c61d75933d24084915a98d257d444 (diff)
downloadswift-475cec615cda74aa34d9519239e2f627256ef71d.zip
swift-475cec615cda74aa34d9519239e2f627256ef71d.tar.bz2
Created a generic CocoaAction.
Diffstat (limited to 'Slimber/Cocoa/CocoaAction.mm')
-rw-r--r--Slimber/Cocoa/CocoaAction.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/Slimber/Cocoa/CocoaAction.mm b/Slimber/Cocoa/CocoaAction.mm
new file mode 100644
index 0000000..15498a1
--- /dev/null
+++ b/Slimber/Cocoa/CocoaAction.mm
@@ -0,0 +1,22 @@
+#include "Slimber/Cocoa/CocoaAction.h"
+
+@implementation CocoaAction
+
+- (id) initWithFunction: (boost::function<void()>*) f {
+ if ([super init]) {
+ function = f;
+ }
+ return self;
+}
+
+- (void) dealloc {
+ delete function;
+ [super dealloc];
+}
+
+- (void) doAction: (id) sender {
+ (void) sender;
+ (*function)();
+}
+
+@end