Skip to content

Instantly share code, notes, and snippets.

@yohfee
Created May 11, 2011 08:47
Show Gist options
  • Select an option

  • Save yohfee/966128 to your computer and use it in GitHub Desktop.

Select an option

Save yohfee/966128 to your computer and use it in GitHub Desktop.
require 'mscorlib'
require 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
require 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
include System::Drawing
include System::Windows::Forms
class MyForm < Form
def initialize
button = Button.new
button.location = Point.new(150, 150)
button.text = "Click"
button.click {|sender, e| MessageBox.show 'Hello world!', self.text}
self.controls << button
self.text = "WinForm on Ruby"
self.size = Size.new(400, 400)
end
end
Application.run MyForm.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment