我正在尝试在鞋子上构建GUI。但是,当我单击按钮时,我无法打开新窗口。请帮助。当我单击文件按钮时,我想打开一个新窗口,它将有更多按钮。
代码是:
Shoes.app(:width => 500 ,:height => 500) do
@File = button "FILE" , :width => 80 , :height => 30 do
window :title => 'new window' ,:width => 300 ,:height => 300 do
para "hello"
end
end
@File.move(300,100)
@fileimage = image 'instagram.png' , :width => 50 , :height =>50
@fileimage.move(220,100)
@Options = button "OPTIONS" , :width => 80 , :height => 30 do
alert "options button"
end
@Options.move(300,170)
@optionsimage = image 'cog2.png' , :width => 50 , :height =>50
@optionsimage.move(220,160)
@help = button "HELP" , :width => 80 , :height => 30do
alert "Help button"
end
@help.move(300,230)
@helpimage =image 'Dzone-Logo-Square-Webtreatsetc.png',:width => 50 , :height => 50
@helpimage.move(220,220)
@about = button "ABOUT" , :width => 80 , :height => 30 do
alert "About button"
end
@about.move(300,280)
@aboutimage =image 'thumbs-up.png',:width => 50 , :height => 50
@aboutimage.move(220,280)
end
这是绿色鞋子的例子
require 'green_shoes'
Shoes.app title: "The Owner" do
button "Pop up?" do
window do
para "Okay, popped up from #{owner}"
end
end
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句