Tag Archives: Closures

Blocks as Closures (Part 1)

As it turns out, blocks are the ideal tool for use ion implementing user interfaces where we have a defined graphic that signifies a button and pressing that button would result in a pre-set series of processes. A simple button definition can be:
bPlay = Button.new(“Play”)
bPause = Button.new(“Pause”)
# so on and so forth……
If a user presses [...]

Posted in Development, Programming Basics | Also tagged | Comments closed