ysitbook 发表于 2011-03-14 13:51

使用 wxRuby 创建 GUI 应用程序

#!/usr/bin/ruby -w
require 'wxruby'
class TroutApp < Wx::App
def on_init
    frame = Wx::Frame.new(nil, -1, 'Tiny wxRuby Application')
    panel = Wx::StaticText.new(frame, -1, 'You are a trout!',
                               Wx::Point.new(-1,1), Wx::DEFAULT_SIZE,
                               Wx::ALIGN_CENTER)
    frame.show
end
end

TroutApp.new.main_loop
页: [1]
查看完整版本: 使用 wxRuby 创建 GUI 应用程序