Hello world 之 wxRuby 版

2015-06-02 0 195
Hello world 之 wxRuby 版
 require "wx"
 include Wx

 # a new class which derives from the Wx::App class
 class HelloWorld < App
   # we're defining what the application is going to do when it starts
   def on_init  
     # it's going to make a frame entitled "Hello World"
     helloframe = Frame.new(nil, -1, "Hello World")
     # it's going to put the text "Hello World" in that frame
     StaticText.new(helloframe,-1,"Hello World")
     # and then it's going to make the window appear
     helloframe.show()
   end
 end
 # and this line makes it actually do it!
 HelloWorld.new.main_loop 

遇见资源网 ruby Hello world 之 wxRuby 版 http://www.ox520.com/16352.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务