diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-08-02 13:15:38 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-08-02 13:18:16 (GMT) |
commit | 475cec615cda74aa34d9519239e2f627256ef71d (patch) | |
tree | f70c4d7ffb221eefd2b31a38ff1b948ad0faab1a /Slimber/Cocoa/CocoaAction.mm | |
parent | 04d48741240c61d75933d24084915a98d257d444 (diff) | |
download | swift-contrib-475cec615cda74aa34d9519239e2f627256ef71d.zip swift-contrib-475cec615cda74aa34d9519239e2f627256ef71d.tar.bz2 |
Created a generic CocoaAction.
Diffstat (limited to 'Slimber/Cocoa/CocoaAction.mm')
-rw-r--r-- | Slimber/Cocoa/CocoaAction.mm | 22 |
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 |