-
-
Save drart/6656653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// | |
// Created by Greg Debicki. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Slider *slider; | |
C4Shape *shape; | |
CGPoint p; | |
} | |
-(void)setup { | |
shape = [C4Shape rect:CGRectMake(0, 0, 200, 200)]; | |
p = self.canvas.center; | |
p.y -= 50; | |
shape.center = p; | |
[self.canvas addShape:shape]; | |
slider = [C4Slider slider:CGRectMake(0, 0, 400, 44)]; | |
p.y += 200; | |
slider.center = p; | |
[slider runMethod:@"adjustRotation:" target:self forEvent:VALUECHANGED]; | |
[self.canvas addSubview:slider]; | |
} | |
-(void)adjustRotation:(C4Slider *)sender { | |
shape.rotation = sender.value * TWO_PI; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment