Skip to content

Instantly share code, notes, and snippets.

@C4Examples
Created April 5, 2013 22:08
Show Gist options
  • Save C4Examples/5323042 to your computer and use it in GitHub Desktop.
Save C4Examples/5323042 to your computer and use it in GitHub Desktop.
C4UIElements sliderActionValue
//
// 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
@drart
Copy link

drart commented Sep 22, 2013

Here is a link to a gist that updates the alloc/init section of C4Slider. https://gist.github.com/drart/6656653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment