Skip to content

Instantly share code, notes, and snippets.

@hvgotcodes
Created May 9, 2012 02:17
Show Gist options
  • Save hvgotcodes/2641269 to your computer and use it in GitHub Desktop.
Save hvgotcodes/2641269 to your computer and use it in GitHub Desktop.
for color, i in ['yellow', 'red', 'white', 'blue', 'red']
@container.add view = Ti.UI.createView
backgroundColor: color
top: 2
left: 2 + 42 * i
height: 20,
width: 40
view.addEventListener 'click', ((color, selection) ->
(e) ->
Ti.API.info "color #{ color }"
selection.backgroundColor = color
)(color, @selection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment