Created
April 5, 2013 22:08
-
-
Save C4Examples/5323042 to your computer and use it in GitHub Desktop.
C4UIElements sliderActionValue
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 alloc] initWithFrame: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
Here is a link to a gist that updates the alloc/init section of C4Slider. https://gist.github.com/drart/6656653