通过Linux编程GUI [英] Programming GUI over linux

查看:97
本文介绍了通过Linux编程GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Windows上C#和Java的高级程序员

我想让gui程序可以在Linux上运行

我知道Java可以做到这一点,但是我想让gui也可以学习的另一种语言

有人要求我学习python. python可以很容易地使gui吗?以及我可以使用哪些程序进行编译,例如VS 2010 for c#

i am a senior programmer on C# and java over windows

i want to make gui programs to work over linux

i know that java do this but i want another language that make gui too to be learned

some people ask me to learn python. is python can make gui easily ? and what is the program that i can compile it using, like VS 2010 for c#

推荐答案

如果您有C#的使用经验,建议:在Windows for Microsoft.NET上开发应用程序 .使用System.Windows.Forms(不是WPF,不是Metro).如果您的应用程序不使用任何Windows特定的代码(例如直接处理Windows消息),则不进行P/Invoke,并且通常仅限于标准(Form本身是非标准的库,但是您可以使用它,也可以使用ADO.NET等,但是大多数代码应基于标准的CLI BCL, http://en.wikipedia .org/wiki/Base_Class_Library [ ^ ]), 您可以在Linux上运行此类应用程序而无需重新编译!

如何?好吧,有了Mono:
http://en.wikipedia.org/wiki/Mono_%28software%29 [ ^ ],
http://www.mono-project.com/Main_Page [ http://en.wikipedia.org/wiki/MonoDevelop [ http://monodevelop.com/ [ ^ ].

它在Linux以及Windows和其他平台上都可用.在Windows上,您也可以使用#develop:
http://en.wikipedia.org/wiki/SharpDevelop [ http://www.icsharpcode.net/ [ ^ ].

这个有什么好处?您可以使用它来开发具有不同库GTK#的UI,该库也是多平台的,并且在不同平台之间具有更好的兼容性.自然,它基于GTK,也可用于所有这些平台:
http://en.wikipedia.org/wiki/GTKSharp [ http://www.mono-project.com/GtkSharp [ http://en.wikipedia.org/wiki/GTK%2B [ http://www.gtk.org/ [ ^ ].

[END EDIT#1]

Mono适用于多种平台:Windows,Linux,Mac OS X,iOS,Android等.



顺便说一句,请参阅有关Qt的解决方案2.这不仅是另一个主要用于C ++的多平台UI库,而且还带有CLI封装(或者我不确定端口),因此您还可以在Windows和Linux上将其与Mono一起使用(和其他平台).

请在此处查看可用的绑定:
http://en.wikipedia.org/wiki/Qt_%28framework%29 [ ^ ].

总体看一下Mono UI工具包:
http://www.mono-project.com/Gui_Toolkits [
If you have some experience with C#, I would recommend the following: develop your application on Windows for Microsoft.NET. Use System.Windows.Forms (not WPF, not Metro). If your application does not use any Windows-specific code (like direct manipulation with Windows messages), no P/Invoke, and is in general confined to the standards (Form is itself a non-standard library, but you can use it, you can also use ADO.NET and something else, but most of the code should be based on standard CLI BCL, http://en.wikipedia.org/wiki/Base_Class_Library[^]), you can run such application on Linux without re-compilation!

How? Well, with Mono:
http://en.wikipedia.org/wiki/Mono_%28software%29[^],
http://www.mono-project.com/Main_Page[^].

I usually do it in three steps: 1) develop or update code using Visual Studio on Windows; 2) test it under Mono on Window; 3) test it on Linux or other platform under Mono.



If you need to develop it in Linux, the available IDE is MonoDevelop:
http://en.wikipedia.org/wiki/MonoDevelop[^],
http://monodevelop.com/[^].

It is available on Linux, and also on Windows and other platforms. On Windows, you can also use #develop:
http://en.wikipedia.org/wiki/SharpDevelop[^],
http://www.icsharpcode.net/[^].

What''s good about this one? You can use it to develop UI with a different library, GTK#, which is also multi-platform and has better compatibility of different platforms. Naturally, it is based on GTK, also available for all these platforms:
http://en.wikipedia.org/wiki/GTKSharp[^],
http://www.mono-project.com/GtkSharp[^],
http://en.wikipedia.org/wiki/GTK%2B[^],
http://www.gtk.org/[^].

[END EDIT #1]

Mono is available for a number of platforms: Windows, Linux, Mac OS X, iOS, Android and more.



By the way, see Solution 2 about Qt. Not only this is another multi-platform UI library, mostly for C++, but it is also comes CLI-wrapped (or a port, I''m not sure), so you also can use it with Mono on both Windows and Linux (and other platforms).

Please see the available bindings here:
http://en.wikipedia.org/wiki/Qt_%28framework%29[^].

Look at the Mono UI toolkits in general:
http://www.mono-project.com/Gui_Toolkits[^].

You will be fine on Linux, don''t worry… :-)

[END EDIT #2]

—SA


[在对问题的评论中对Python讨论的回应:]

Python可被视为Linux上UI开发(Web开发除外)的另一种选择.请查看可以使用的一组UI工具包:
http://en.wikibooks.org/wiki/Python_Programming/GUI_Programming [ http://docs.python.org/library/wsgiref.html [ http://en.wikipedia.org/wiki/IronPython [ http://www.mono-project.com/Python [ http://ironpython.codeplex.com/wikipage?title=IronPython%20on%20Mono [ ^ ].

顺便说一下,Mono上的所有CLI应用程序都是通过命令行启动的,例如
[In response to Python discussion in the comments to the question:]

Python could be considered as another alternative for UI development (except for Web development) on Linux. Please look at the set of UI toolkits you could use:
http://en.wikibooks.org/wiki/Python_Programming/GUI_Programming[^].

Just in case, on Web development see also:
http://docs.python.org/library/wsgiref.html[^].



As you actually can use IronPython on Mono, it can also be used to develop Linux applications to run under Mono:
http://en.wikipedia.org/wiki/IronPython[^],
http://www.mono-project.com/Python[^],
http://ironpython.codeplex.com/wikipage?title=IronPython%20on%20Mono[^].

By the way, all CLI applications on Mono are started with the command line like
mono MyApplication.exe



-SA



—SA


http://qt.digia.com/product / [^ ]


如果您了解C ++,则可以尝试Qt框架
它为所有gui套件提供了c ++框架


检查 http://en.wikipedia.org/wiki/Qt_(framework) [ http://qt-project.org/downloads [
http://qt.digia.com/product/[^]


If you know C++ you can try Qt framework
it provide all gui kits with the c++ framework


check http://en.wikipedia.org/wiki/Qt_(framework)[^]

http://qt-project.org/downloads[^]


这篇关于通过Linux编程GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆