Windows 上的 Perl GUI 编程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12495720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Perl GUI programming on Windows
提问by microbe
I'm looking for tools for Perl GUI programming on Windows for educational/in-house development, mostly science related.
我正在寻找在 Windows 上进行 Perl GUI 编程的工具,用于教育/内部开发,主要与科学相关。
My first choice was PerlQt. A friend of mine was developing with Qt and C++ so I expected getting some help from him. Also Qt has a GUI creator and Linux has nice integration with Perl. Unfortunately, I failed to make it work on Windows. I searched for other options and am still not clear after search. This is what I've got so far.
我的第一选择是 PerlQt。我的一个朋友正在使用 Qt 和 C++ 进行开发,所以我希望能从他那里得到一些帮助。此外,Qt 有一个 GUI 创建者,Linux 与 Perl 有很好的集成。不幸的是,我未能使其在 Windows 上运行。我搜索了其他选项,但搜索后仍然不清楚。这是我到目前为止所得到的。
- Perl/Tk: broad user base, good documentation, relatively low learning curve. But old look and may not be active. Yet some articles say it is rebooted now and has native look.
- wxPerl: native look. But steep learning curve. Not all wx library is ported to Perl. Some like it and some hate it.
- Win32:GUI: native look, can use all Windows API. Needed force install because one of the tests was failed. Still works but not sure it was installed correctly.
- XUL::GUI: using FireFox engine, CSS typing.
- Perl/Tk:广泛的用户群,良好的文档,相对较低的学习曲线。不过老样子又可能不活跃。然而,一些文章说它现在重新启动并具有原生外观。
- wxPerl:原生外观。但学习曲线陡峭。并非所有 wx 库都移植到 Perl。有人喜欢,有人讨厌。
- Win32:GUI:原生外观,可以使用所有 Windows API。需要强制安装,因为其中一项测试失败。仍然有效,但不确定它是否正确安装。
- XUL::GUI:使用 FireFox 引擎,CSS 类型。
I could managed to install them and succeeded to show "Hello, world". Yet, I can't decide which one to go and the online information sometimes looks contradict each other.
我可以设法安装它们并成功显示“你好,世界”。然而,我无法决定去哪一个,而且网上的信息有时看起来相互矛盾。
Would you compare the tools in terms of human efficiency (easy to read and write codes), computational efficiency and the availability of GUI builder?
您会在人力效率(易于阅读和编写代码)、计算效率和 GUI 构建器的可用性方面比较这些工具吗?
回答by Joel Berger
For real cross platform GUI programming I would suggest Prima
or Tk
. Neither look great, but they work.
对于真正的跨平台 GUI 编程,我建议使用Prima
或Tk
. 两者看起来都不错,但它们有效。
Still, I think you might be better served (hehe) by using a web front-end than a true GUI these days; this is easy using a web-framework. I would suggest Mojolicious
though other people do like Dancer
. My primary reason for suggesting Mojo over Dancer is that Mojo comes with lots of functionality in one tiny package. Then again, this is the reason that others would recommend Dancer, so that's a toss.
尽管如此,我认为现在使用 Web 前端可能比使用真正的 GUI 更好(呵呵);这很容易使用网络框架。我会建议Mojolicious
虽然其他人确实喜欢Dancer
。我推荐 Mojo 而不是 Dancer 的主要原因是 Mojo 在一个小包中提供了许多功能。话又说回来,这也是其他人会推荐Dancer的原因,所以这是一个折腾。
A final consideration is that Mojo comes with WebSockets out of the box. This makes it rather easy for your webapp to feel more like a true application, talking back to the server and getting responses without reloading.
最后一个考虑是 Mojo 带有开箱即用的 WebSockets。这使您的 web 应用程序更容易感觉更像一个真正的应用程序,与服务器对话并在不重新加载的情况下获得响应。
Edit: I now have a good example of a desktop application written with a Perl/Mojo backend and a web-frontent: Azawawi's Farabi
. It is a text-editor, geared towards writing Perl. It's GUI is the browser, making it a simple cross-platform editor. I recommend it as a starting point for similar tasks.
编辑:我现在有一个使用 Perl/Mojo 后端和 Web 前端编写的桌面应用程序的好例子:Azawawi 的Farabi
. 它是一个文本编辑器,面向编写 Perl。它的 GUI 是浏览器,使其成为一个简单的跨平台编辑器。我推荐它作为类似任务的起点。
回答by kmx
回答by Lorenz Lo Sauer
Here is a good overview of widget toolkits- many of which provide wrappers to popular programming languages:
这是小部件工具包的一个很好的概述 - 其中许多为流行的编程语言提供了包装器:
http://en.wikipedia.org/wiki/List_of_widget_toolkits
http://en.wikipedia.org/wiki/List_of_widget_toolkits
I recommend [wxwidgets][1]
aka wxwindows
, or a browser based solution (e.g. XULrunner) or a pure Javascript+HTML5 based solution. At the moment I am working on a cross-platform tool with only a basic console UI, which then uses websockets and HTML5 + SVG for a more complex UI rendition and UX. To make the web-content dynamic I use a simple template-engine.
我推荐[wxwidgets][1]
akawxwindows
或基于浏览器的解决方案(例如 XULrunner)或基于纯 Javascript+HTML5 的解决方案。目前我正在开发一个只有基本控制台 UI 的跨平台工具,然后使用 websockets 和 HTML5 + SVG 来实现更复杂的 UI 呈现和 UX。为了使网络内容动态化,我使用了一个简单的模板引擎。
( Personally, for overview questions, I had good experience to put the term wikipedia
and list of
somewhere in the search query of ones trusted search engine. Kudos to the diligent wikipedia community.)
(就个人而言,对于概述问题,我有很好的经验,可以将术语wikipedia
和list of
某个位置放在受信任的搜索引擎的搜索查询中。感谢勤奋的维基百科社区。)
回答by runrig
There is an outdated Perl GUI FAQon perlmonks.
perlmonks 上有一个过时的Perl GUI FAQ。
PerlQttracks Qt closely.
PerlQt密切跟踪 Qt。
回答by jira
I have an experience with PerlTk and wxPerl. wxPerl is rather decent toolkit which I can recommend. There is also a GUI builder available wxGlade
我有使用 PerlTk 和 wxPerl 的经验。wxPerl 是相当不错的工具包,我可以推荐它。还有一个 GUI 构建器可用wxGlade
The few applications I had in Tk taught me to hate that toolkit wholeheartedly:
我在 Tk 中的少数应用程序教会我全心全意地讨厌该工具包:
- it looks awful
- disproportional amount of coding time was spent on solving various bugs and finding workarounds for missing features
- 看起来很糟糕
- 不成比例的编码时间花在解决各种错误和寻找缺失功能的解决方法上
回答by user4513835
Hta, HTML application, mshta.exe... Old but works like a charm. Pros: Total access to basically everything you could want for development of in-house trusted apps. Cons: Geometry gets tedious, perlscript (vs vbscript/javascript) documentation/examples are basically nonexistent
Hta、HTML 应用程序、mshta.exe... 旧但功能强大。优点:基本上可以完全访问开发内部可信应用程序所需的所有内容。缺点:几何变得乏味,perlscript(vs vbscript/javascript)文档/示例基本上不存在