Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
extensions:sx_switch [2011/04/12 08:29]
pixelrevision created
extensions:sx_switch [2015/09/14 11:14] (current)
Line 1: Line 1:
 +~~NOTOC~~
  
 +====== SXSwitch ======
 +
 +---- dataentry extension ----
 +type          : extension ​ # or '​mod'​ if it requires changing the Sparrow source ​
 +author_mail ​  : pixelrevision@gmail.com Malcolm ​
 +description ​  : A simple switch similar to UISwitch ​          # enter a short description of the extension
 +lastupdate_dt : 2011-4-11 # the date you created the extension
 +compatible ​   : v1.1       # the Sparrow version you tested the extension with
 +depends ​      : ​           # if the ext. depends on others, list them here
 +tags          : uiswitch, switch, toggle ​          # enter a few tags, separated by commas
 +homepage_url ​ : https://​gist.github.com/​915041 ​          # if the ext. has an URL (e.g. a Gist-page), add it here
 +download_url ​ : https://​gist.github.com/​gists/​915041/​download ​          # a direct link to the download (e.g. the Gist-archive)
 +----
 +
 +===== Usage =====
 +
 +<code objc>
 +- (id)initWithWidth:​(float)width height:​(float)height {
 +    self = [super initWithWidth:​width height:​height];​
 + sxSwitch = [[SXSwitch alloc] init];
 + [sxSwitch addEventListener:​@selector(onValueChange:​) atObject:​self forType:​SX_SWITCH_EVENT_CHANGED];​
 + [self addChild:​sxSwitch];​
 +    return self;
 +}
 +
 +- (void)onValueChange:​(SPEvent*)event{
 + NSLog(@"​slider val: %@", (sxSwitch.on)?​@"​true":​@"​false"​);​
 +}
 +</​code>​
 +
 +===== Changelog =====
 +
 +  * //​2011/​04/​12 08:25//: First public version
 +
 +===== Source Code =====
 +
 +%gist(915041)%
 +
 +===== Discussion =====
 +
 +//No comments so far. Feel free to edit this part of the page.//
  extensions/sx_switch.txt · Last modified: 2015/09/14 11:14 (external edit)
 
Powered by DokuWiki