public
Description: deepblue's thoughts
Homepage: http://myruby.net/
Clone URL: git://github.com/deepblue/snippets.git
Bryan Kang (author)
Sun Feb 08 18:55:02 -0800 2009
commit  50bcfcc83070f51559557fec8c20256fc72e781f
tree    fd5e69329803b69cb67cb4795a58ee36ec547764
parent  b188bf3aacdc917b1cbd03bedb35745d9992da71
snippets / chalenge / hello_ui / hello_macruby.rb
100644 18 lines (15 sloc) 0.403 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'hotcocoa'
include HotCocoa
 
alert = Proc.new {
  NSAlert.alertWithMessageText("I'm MacRuby",
    defaultButton: "OK",
    alternateButton: "Cancel",
    otherButton: nil,
    informativeTextWithFormat: "HotCocoa").
  runModal
}
 
application do |app|
  window :frame => [100, 100, 100, 60], :title => "MacRuby!" do |win|
    win << button(:title => "Hello!", :on_action => alert)
  end
end