Skip to content

Instantly share code, notes, and snippets.

@glurp
Created February 22, 2012 23:09
Show Gist options
  • Select an option

  • Save glurp/1888245 to your computer and use it in GitHub Desktop.

Select an option

Save glurp/1888245 to your computer and use it in GitHub Desktop.
Ruiby hello words
require_relative '../lib/ruiby'
class RubyApp1 < Ruiby_gtk
def component() slot( label("Hello, world!") ) end
end
. . . . . . . . . . . . . . .
class RubyApp0 < Ruiby_gtk
def component()
lc=File.read(__FILE__).split(/cl[a]ss/)
lcode=lc[1..-2].map { |code| "cla"+"ss "+ code }
democode= "cla"+"ss "+ lc.last
stack do
slot( label("\n\n\n\tPlease, Choose one of this hello-world version... \n\n",
:font=> "Verdana 12") )
lcode.each_with_index { |code,i|
slot(button(code) { system("ruby",$0,(i+1).to_s) } )
}
slot(button("What's that ?") {
Editor.new(self,democode)
})
end
rposition(300,300)
end
end
Gtk.init
window = eval("RubyApp"+(ARGV[0]||'0')).new("Hw",200,100)
Gtk.main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment