Greetings,
I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever?
我想在其中编写一个带有GUI的小型跨平台实用程序。我应该坚持哪种语言/ GUI库?有可能吗?
This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively?
这将是一个小程序,所以我不想让人们下载JVM或.NET Framework。是否可以原生发展?
Update 1.
By "natively" I mean that the end result will be native code without intermediate layers like Java Virtual Machine or .NET Common Language Runtime
“本机”是指最终结果将是没有Java虚拟机或.NET公共语言运行时等中间层的本机代码
Update 2.
A FREE solution is preferable ;)
免费解决方案更可取;)
15 个解决方案
#1
15
If you know C or C++ the first cross platform GUI framework I can think of are:
如果您了解C或C ++,我能想到的第一个跨平台GUI框架是:
- QT (C++, proprietary but free with the LGPL licensing)
- wxWidgets (C++, the most complete and stable but also huge)
- FLTK (C++)
- FOX (C++)
- IUP (C, simpler and cleaner than the ones above)
QT(C ++,专有但免费获得LGPL许可)
wxWidgets(C ++,最完整,最稳定但也很庞大)
IUP(C,比上面的更简单,更清洁)
If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.
如果你认识Pascal,你可以尝试freepascal + Lazarus。不过,我从来没用过它。
#2
6
The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.
问题是:如果你不想拥有一个GUI,但你不想要求用户下载一个永久的API,框架或虚拟机来运行它,无论是TCL / TK,Java还是QT等,那么你迷路得很快。
The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .
原因是:您必须重建所有(GUI)功能,这些API,框架和虚拟机为您提供独立于平台的功能。这需要做很多工作......
On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?
另一方面:Java虚拟机几乎可以从头开始安装在任何操作系统上,为什么不试一试呢?
#3
5
You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.
您想本地开发跨平台程序吗?呃......我认为这不会起作用,主要是因为这句话是一个悖论。如果你编写本机代码,它本质上只会在你编程的平台上运行。 ;-)这就是框架的全部内容。
So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.
所以你应该做的是使用一个非常纤薄的框架,如果你的程序将如此之小。 itmatt对Qt的看法是可能的。
#4
4
WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/
wxWindows的?哦,它现在被称为WxWidgets:http://www.wxwidgets.org/
#5
4
wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.
wxWidgets绑定了各种语言 - 例如python,如果你的应用程序足够小的话。
#6
4
Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)
拉撒路很棒。 Linux上的GTK2,Windows上的win32 / 64,euh上的WINCE,Wince。它甚至在Mac上使用Carbon(在COCOA上工作)。也很容易卖给你的老板(代码是Delphi兼容的)
#7
3
How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'
使用Qt或Wx然后使用PythonToExe制作'可分发'的Python怎么样?
Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled
我们必须考虑开发以确保不使用本机功能(即注册表等)。文本文件中的换行符之类的东西也会有不同的转义字符,因此需要处理
#8
3
Which OS's do you have in mind when you say cross-platform?
当你说跨平台时,你有哪些操作系统?
As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.
正如Epaga正确指出的那样,原生和跨平台是相互排斥的。您可以编写在多个平台上本机运行的多个版本,也可以使用某些跨平台框架。
In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.
在跨平台框架方法的情况下,总是需要额外的安装。例如,许多人建议使用Python及其框架之一。这将需要指导人们首先安装python - 可能还有框架。
If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.
如果您的目标是Windows和OS X(如果需要支持该操作系统,我们准备尝试使用Linux的alpha版本代码),我强烈建议您查看使用Adobe AIR进行跨平台GUI应用程序。
#9
3
I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.
我同意Georgi,Java是要走的路。通过一些工作,您可以使您的桌面应用程序也可以作为Java小程序工作(这样用户根本不需要主动下载任何内容)。请参阅http://www.geogebra.org作为应用程序的示例,该应用程序可以作为跨平台Java应用程序顺利运行,并且具有到Web小程序的简单端口。
Two other advantages to using Java are:
使用Java的另外两个好处是:
- They have extensive libraries for building the UI, including UI component builders.
- The Java runtime framework is generally updated automatically for the user.
他们有广泛的库来构建UI,包括UI组件构建器。
Java运行时框架通常会自动为用户更新。
One disadvantage:
- The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
最终用户计算机上安装的Java版本可能与您的应用程序不完全兼容,要求您编写可能性最小的分母。
#10
3
Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.
试试RealBasic。类似Visual Basic的语法,目标是Win32,OS X和Linux。我不知道有关目标Linux的任何细节,但对于我在Win32和OS X之间进行的任何跨平台开发来说,这都是一个梦想。
Edit: Generates native executables. There is a small cost - $100.
编辑:生成本机可执行文件。费用很低--100美元。
#12
2
Flash? It's installed pretty much everywhere.
闪?它几乎无处不在。
#13
1
If it "HAS" to be Desktop use Qt. Nothing beats it right now.
如果它“HAS”是桌面使用Qt。现在没什么比这更好的了。
However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)
不过我亲自在桌面上放弃了,而我所做的任何基于UI的项目通常都是基于浏览器/服务器的。您可以轻松编写一个侦听某个端口的小型自定义服务器,以便程序可以在本地运行,而无需用户安装Apache或访问网络。我有一个小的Lua,Python和C ++框架我为此目的(想要为V8的后端添加Javascript :)
#14
1
If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !
如果您要查看Qt和WxWidgets,请不要忘记查看GTK +!
#15
1
I agree with David Wees and Georgi,
我同意David Wees和Georgi,
Java is cross-platformness par excellence. You literally write once and run everywhere. With no need of compiling your code for each target OS or bitness, no worries about linking against anything, etc.
Java是卓越的跨平台。你实际上写了一次,到处运行。无需为每个目标操作系统或位数编译代码,无需担心链接任何内容等。
Only thing is, as you pointed out, that a JRE must be installed, but it's quick and straightforward to do even for novice end-users (it's a matter of clicking "Next>" a few times in the installer).
正如您所指出的那样,唯一的事情就是必须安装JRE,但即使是新手最终用户也可以快速而直接地进行操作(这是在安装程序中单击“下一步>”几次的问题)。
And with Java Web Start deployment gets even easier: the user just clicks the launch button on a webpage and the application runs (if the proper JVM is installed according to what specified in the JNLP descriptor) or the user gets redirected to the Java download page (if no suitable JVM is found).
使用Java Web Start部署变得更加容易:用户只需单击网页上的启动按钮并运行应用程序(如果根据JNLP描述符中指定的内容安装了正确的JVM),或者用户被重定向到Java下载页面(如果找不到合适的JVM)。
#1
15
If you know C or C++ the first cross platform GUI framework I can think of are:
如果您了解C或C ++,我能想到的第一个跨平台GUI框架是:
- QT (C++, proprietary but free with the LGPL licensing)
- wxWidgets (C++, the most complete and stable but also huge)
- FLTK (C++)
- FOX (C++)
- IUP (C, simpler and cleaner than the ones above)
QT(C ++,专有但免费获得LGPL许可)
wxWidgets(C ++,最完整,最稳定但也很庞大)
IUP(C,比上面的更简单,更清洁)
If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.
如果你认识Pascal,你可以尝试freepascal + Lazarus。不过,我从来没用过它。
#2
6
The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.
问题是:如果你不想拥有一个GUI,但你不想要求用户下载一个永久的API,框架或虚拟机来运行它,无论是TCL / TK,Java还是QT等,那么你迷路得很快。
The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .
原因是:您必须重建所有(GUI)功能,这些API,框架和虚拟机为您提供独立于平台的功能。这需要做很多工作......
On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?
另一方面:Java虚拟机几乎可以从头开始安装在任何操作系统上,为什么不试一试呢?
#3
5
You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.
您想本地开发跨平台程序吗?呃......我认为这不会起作用,主要是因为这句话是一个悖论。如果你编写本机代码,它本质上只会在你编程的平台上运行。 ;-)这就是框架的全部内容。
So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.
所以你应该做的是使用一个非常纤薄的框架,如果你的程序将如此之小。 itmatt对Qt的看法是可能的。
#4
4
WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/
wxWindows的?哦,它现在被称为WxWidgets:http://www.wxwidgets.org/
#5
4
wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.
wxWidgets绑定了各种语言 - 例如python,如果你的应用程序足够小的话。
#6
4
Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)
拉撒路很棒。 Linux上的GTK2,Windows上的win32 / 64,euh上的WINCE,Wince。它甚至在Mac上使用Carbon(在COCOA上工作)。也很容易卖给你的老板(代码是Delphi兼容的)
#7
3
How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'
使用Qt或Wx然后使用PythonToExe制作'可分发'的Python怎么样?
Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled
我们必须考虑开发以确保不使用本机功能(即注册表等)。文本文件中的换行符之类的东西也会有不同的转义字符,因此需要处理
#8
3
Which OS's do you have in mind when you say cross-platform?
当你说跨平台时,你有哪些操作系统?
As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.
正如Epaga正确指出的那样,原生和跨平台是相互排斥的。您可以编写在多个平台上本机运行的多个版本,也可以使用某些跨平台框架。
In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.
在跨平台框架方法的情况下,总是需要额外的安装。例如,许多人建议使用Python及其框架之一。这将需要指导人们首先安装python - 可能还有框架。
If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.
如果您的目标是Windows和OS X(如果需要支持该操作系统,我们准备尝试使用Linux的alpha版本代码),我强烈建议您查看使用Adobe AIR进行跨平台GUI应用程序。
#9
3
I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.
我同意Georgi,Java是要走的路。通过一些工作,您可以使您的桌面应用程序也可以作为Java小程序工作(这样用户根本不需要主动下载任何内容)。请参阅http://www.geogebra.org作为应用程序的示例,该应用程序可以作为跨平台Java应用程序顺利运行,并且具有到Web小程序的简单端口。
Two other advantages to using Java are:
使用Java的另外两个好处是:
- They have extensive libraries for building the UI, including UI component builders.
- The Java runtime framework is generally updated automatically for the user.
他们有广泛的库来构建UI,包括UI组件构建器。
Java运行时框架通常会自动为用户更新。
One disadvantage:
- The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
最终用户计算机上安装的Java版本可能与您的应用程序不完全兼容,要求您编写可能性最小的分母。
#10
3
Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.
试试RealBasic。类似Visual Basic的语法,目标是Win32,OS X和Linux。我不知道有关目标Linux的任何细节,但对于我在Win32和OS X之间进行的任何跨平台开发来说,这都是一个梦想。
Edit: Generates native executables. There is a small cost - $100.
编辑:生成本机可执行文件。费用很低--100美元。
#11
#12
2
Flash? It's installed pretty much everywhere.
闪?它几乎无处不在。
#13
1
If it "HAS" to be Desktop use Qt. Nothing beats it right now.
如果它“HAS”是桌面使用Qt。现在没什么比这更好的了。
However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)
不过我亲自在桌面上放弃了,而我所做的任何基于UI的项目通常都是基于浏览器/服务器的。您可以轻松编写一个侦听某个端口的小型自定义服务器,以便程序可以在本地运行,而无需用户安装Apache或访问网络。我有一个小的Lua,Python和C ++框架我为此目的(想要为V8的后端添加Javascript :)
#14
1
If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !
如果您要查看Qt和WxWidgets,请不要忘记查看GTK +!
#15
1
I agree with David Wees and Georgi,
我同意David Wees和Georgi,
Java is cross-platformness par excellence. You literally write once and run everywhere. With no need of compiling your code for each target OS or bitness, no worries about linking against anything, etc.
Java是卓越的跨平台。你实际上写了一次,到处运行。无需为每个目标操作系统或位数编译代码,无需担心链接任何内容等。
Only thing is, as you pointed out, that a JRE must be installed, but it's quick and straightforward to do even for novice end-users (it's a matter of clicking "Next>" a few times in the installer).
正如您所指出的那样,唯一的事情就是必须安装JRE,但即使是新手最终用户也可以快速而直接地进行操作(这是在安装程序中单击“下一步>”几次的问题)。
And with Java Web Start deployment gets even easier: the user just clicks the launch button on a webpage and the application runs (if the proper JVM is installed according to what specified in the JNLP descriptor) or the user gets redirected to the Java download page (if no suitable JVM is found).
使用Java Web Start部署变得更加容易:用户只需单击网页上的启动按钮并运行应用程序(如果根据JNLP描述符中指定的内容安装了正确的JVM),或者用户被重定向到Java下载页面(如果找不到合适的JVM)。