Ruby Tutorial with lots of examples

I have been doing this long example filled ruby page in japanese with the help of babel fish.  

I’m finding it very good dispite the odd error where the example doesnt work as ruby has changed.

Its pretty hard to search for another example with the correct code.

For example this piece of code is supposed to react to a right click

#!/usr/bin/env ruby
require “tk”

TkLabel.new {
  width 10
  height 2
  text “Hello!!”
  bind ‘Button-2’, proc { print “Click!\n” } 
  pack 
}

Tk.mainloop

I havent found another example that does yet. I will post here when I do.

Tags: , , .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: