如何在 Windows、Mac、Android 中使用 Seed 用 JavaScript 编写独立应用程序?
使用 Javascript 语言和 Seed 看起来很棒。但是如何在 Windows、Mac、Android 中使用它呢? 有可用的端口吗?
我试图在跨平台中测试它们,在我的 Gnome 中它只能工作,例如: http://git.gnome.org/browse/seed-examples/tree/
#!/usr/bin/env seed
Gtk = imports.gi.Gtk;
Gtk.init(Seed.argv);
var window = new Gtk.Window({title: "Example"});
window.signal.hide.connect(Gtk.main_quit);
window.show_all();
Gtk.main();
Use Javascript language with Seed looks great. But how do you use it in Windows, Mac, Android?
Is there any port available for those?
I was trying to test them in cross-platforms where in my Gnome it works only, such as: http://git.gnome.org/browse/seed-examples/tree/
#!/usr/bin/env seed
Gtk = imports.gi.Gtk;
Gtk.init(Seed.argv);
var window = new Gtk.Window({title: "Example"});
window.signal.hide.connect(Gtk.main_quit);
window.show_all();
Gtk.main();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能不是您正在寻找的答案,但 seed wiki 指出种子是为“GNOME平台”,它没有附带跨平台 GTK 一体化软件包。
如果您想使用 javascript 进行轻量级和以解释器为中心的跨平台开发,您可能需要看看 Mozilla 的 rhino (可能与 swt 结合使用,我发现这非常简单 - 做了几个可以工作的脚本在 osx/win/linux 上(如果机器有 java 和 js.jar),或 node.js (如果不需要 gui,我从来没有以跨平台方式使用节点图形绑定) -来自英特尔开源部门的node-webkit看起来也很有趣。
如果 Android 是必须的并且您想放弃解释器,您可以尝试 as3 (flex sdk 是“免费”的,现在我们有专属运行时空气应用程序)或 neko/haxe强>,它们是ecmascript方言,但是当然有相当多的可能性;这些是我之前看过的。希望它有帮助,如果没有帮助,抱歉。
It might not be the answer you are looking for, but the seed wiki states that seed is for the "GNOME platform", it's not coming with a cross platform GTK all-in-one package.
If you want to do lightweight and interpreter-centric cross platform development with javascript, you may want to look at Mozilla's rhino (probably coupled with swt, I found that pretty easy - did a couple of scripts that work on osx/win/linux if the machine has java and js.jar), or node.js (if no gui is required, I never had luck with node graphical bindings in a cross platform fashion) - node-webkit from Intel's opensource department also looks interesting.
If Android is a must and you care to give up interpreters, you may try as3 (the flex sdk is "free" and now we have captive runtime air apps) or neko/haxe, they are ecmascript dialects, but of course there are quite a lot of possibilities; these are the ones I looked at earlier. Hope it helps and sorry if it did not.
Szabolcs Kurdi 是对的,但是有一个解决方案可以让 javascript 在 Windows 中与 gui 一起工作。
它称为app.js,是一个高度开发的nodejs模块。 (Windows、Mac、Linux)
appjs.org
如果您愿意,请查看。我个人使用它并且喜欢它。
你甚至可以通过调用 window.frame.openDevTools(); 在其中使用 webkits javascript 调试器
你可以将模块方法转发到它的 dom 中。
除了使用 appjs 之外,您还可以在 Windows 中使用 .hta 文件,以便使用 javascript 创建表单。
但我不推荐这样做,因为 microsoft jscript 在可调试性、性能和支持方面非常有限。
您还需要记住,gnome 在其核心中以多种方式使用 javascript,因此它具有 api 到本机方法,而您在 microsoft 的 jscript 中找不到这些方法。
为了获得类似的东西,我强烈推荐您使用nodejs,因为您可以使用数千个模块扩展它(而appjs就是其中之一)。
Szabolcs Kurdi is right but there is a solution to get javascript to work with gui in Windows.
its called app.js and is a highly developed nodejs module. (Windows, Mac, Linux)
appjs.org
check it out if you like. i personaly use it and love it.
you even can use webkits javascript debugger IN it by calling window.frame.openDevTools();
and you can forward module methods into the dom of it.
besides using appjs you could use .hta files in windows in order to create forms using javascript.
i would not recommend this though since microsoft jscript is very limited in debuggability, performance and support.
you also need to keep in mind that gnome uses javascript in its core in multiple ways so it has api's to native methods that you will not find in microsoft's jscript.
in order to get something similar i would srsly recommend you nodejs since you can extend it with thousands of modules (while appjs is one of them).