【发布时间】:2015-08-29 02:06:06
【问题描述】:
我一直在使用 ocra 将我的 ruby 文件转换为窗口可执行文件,但我注意到如果我使用像 fxruby 或 green_shoes 这样的 ruby GUI 需要很长时间。有什么方法可以减少程序弹出所需的时间吗?我目前的fxruby和green_shoes文件很简单,但是编译好的exe文件运行大约需要一分钟。
这是我的 fxruby.rb 文件:
require 'fox16'
include Fox
theApp = FXApp.new
theMainWindow = FXMainWindow.new(theApp, "Hello")
theButton = FXButton.new(theMainWindow, "Hello, world!")
theButton.connect(SEL_COMMAND) do |sender, selector, data|
exit
end
theApp.create
theMainWindow.show
theApp.run
这是我的 green_shoes.rb:
require 'green_shoes'
Shoes.app do
button "OK!"
button "Are you sure?"
end
有什么策略可以让它们运行得更快吗?或者可能是另一个更快的 ruby GUI 选项?谢谢!!
【问题讨论】:
-
我不太确定您要做什么。绿鞋程序最多应该在几秒钟内启动,我会说你的转换器似乎有问题。 Shoes 有打包程序来打包应用程序(到 exe 等),因此你可以尝试 Shoes 3.2,Shoes 4 还没有很好的 windows 打包(但你可以打包到 .jar 文件)
标签: ruby user-interface shoes ocra fxruby