gpt4 book ai didi

ruby - 如何通过点击鞋子 ruby 中的按钮打开一个新窗口

转载 作者:太空宇宙 更新时间:2023-11-03 16:27:04 24 4
gpt4 key购买 nike

我正在尝试在鞋中构建 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

关于ruby - 如何通过点击鞋子 ruby 中的按钮打开一个新窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22710707/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com