Singapore.rb meeting presentation slides and source code

I’m pretty glad to say that the Singapore.rb event went rather well today. The crowd was quite respectable, I think, maybe around 20+ people in all were there, old and new. Meeting up with people from just curious to looking around for programmers were quite heartening, from the days when it was just Choon Keat and I pinging each other on my blog and then over email.

Anyway for the participants of the even today, here are my slides in PDF.

FxRuby and Screensvr slides

And here are the source code:

This is a the sample code in Ruby/Tk.

require 'tk'

root =
button = {
    text "Click me"
    command proc { puts "Hello world!" }

This is the sample code in wxRuby.

require 'wx'
include Wx

class FxApp < App
 def on_init
  frame = nil, -1, "Wx2 Hello"
  panel = frame, 1
  button = panel,  2, "Click me"
  button.evt_left_down() { | event | puts "Hello world!"  }

This is the sample code in Ruby-GTK2.

require 'gtk2'
include Gtk

window =
window.signal_connect("destroy") { Gtk.main_quit }
button = "Click me"
button.signal_connect("clicked") {  puts "Hello world!" }

window.add button


This is the sample code in FxRuby.

require 'fox16'
include Fox

app =

main = app, "Fx Hello"
button = main, "Click me!"
button.connect(SEL_COMMAND) {  puts "Hello world!" }

This is the slightly more complex code in FxRuby.

require 'fox16'
require 'fox16/colors'
require 'fox16/kwargs'
include Fox

app =

main =, "Fx Hello",
                             :opts  => FXTopWindow::DECOR_ALL,
                             :width => 200,
                             :height => 100)

                         :width => 200,
                         :height => 55) {|pane| pane.backColor = FXColor::White }

                            :width => 200,
                            :height => 15) {|slider| slider.value = 0}

slider.connect(SEL_COMMAND) {  pane.text = "Argh! You let go!" }
slider.connect(SEL_CHANGED) {  pane.text = "Current slider value: #{slider.value}" }

Finally the complex looking graphics manipulation sample application you saw is actually glviewer.rb in the samples code in the FxRuby install.

You can download FxRuby from

Hope everyone had fun!

Singapore.rb event at the National Library

The Singapore.rb is going to have a meeting at the National Library on 19 April. The NLB has provided us with a room enough for 50 odd people and wifi-access. It’s going to be a general get-together plus a sharing session. Two speakers has been confirmed more or less — Choon Keat, who will be talking about KRJS and hpricot_forms and myself, who will be talking about FxRuby and Screensvr. Yes, one is about Rails and the other is about Ruby (not Rails). It should be fun and I hope it’ll be start of many more meetings to come, so join us if you’re around in Singapore!

For more information, check on this thread regularly!