wxWidgets与其它GUI工具库比较
WxWidgets Compared To Other Toolkits
Some general notes:
- wxWidgets not only works for C++, but also has bindings for python, perl, php, java, lua, lisp, erlang, eiffel, C# (.NET), BASIC, ruby and even javascript (see General Information for bindings).
- It is one of the most complete GUI toolkits. There are many utility classes.
- There is a lot of documentation (though a bit fragmented in places).
- Free for personal and commercial use.
- Whenever possible, wxWidgets uses the native platform SDK and system provided widgets. This means that a program compiled on Windows will have the look and feel of a Windows program, and when compiled on a Linux machine, it will get the look and feel of a Linux program.
- A positive side effect is that wxWidgets is thus more likely to look, behave and feel native - sometimes including native features for free (e.g. possibility to have spellchecking built-in in all text areas on OS X).
- A negative side effect of this is that it is more likely that the behaviour is different between platforms; toolkits where widgets are lightweight lose some of the native aspect but also minimize platform-specific code (hence minimizing the risk of different behaviour from platform to platform and also minimizing the risk of platform-specific bugs). Concentrating on native looks also mean wx may not be best suited for applications that want a customized look instead of the system's theme.
- wxWidgets got bad publicity for large use of macros, especially event tables. It is however to be noted that there are usually non-macro alternatives, and wxWidgets 2.9 (3.0) especially made a lot of efforts to provide alternatives to the old macro-based techniques, using more modern techniques like templates instead. Therefore while you will likely find a lot of old code containing macros, do not let that convince you that this is all wxWidgets can offer
There is also a slashdot thread about cross-platform gui toolkits. Though it is old and, well, it is slashdot :), there are probably some useful insights there.
Contents
[hide]
Qt
- Both Qt (http://qt.nokia.com/) and wxWidgets have many non-GUI-related classes, such as date/time, containers, networking and OpenGL functionality.
- Qt4.5 is available on MS Windows, Mac, and GNU/Linux under the LGPL and under a commercial license. All ports of wxWidgets are distributed under a permissive modified (but explicitly OSI-approved) LGPL, which allows development and distribution of proprietary applications without license costs.
- Qt doesn't have true native ports like wxWidgets does. Qt does not use system provided widgets, but emulates it with themes. What we mean by this is that even though Qt draws them quite realistically, Qt draws its own widgets on each platform. It's worth mentioning though that Qt comes with special styles for Mac OS X and MS Windows XP and Vista that use native APIs (Appeareance Manager on Mac OS X, UxTheme on Windows XP) for drawing standard widget primitives (e.g. scrollbars or buttons) exactly like any native application. Event handling, the resulting visual feedback and widget layout are always implemented by Qt.
- An approach similar to Qt's is achieved with wxUniversal.
- It should be noted that on KDE and Qt for Embedded Linux platforms, Qt is the native GUI library.
- Qt extends the C++ language with what is called the MOC to provide additional features like signal-slots. An advantage is the nicety of signal-slot event processing; a disadvantage is that this invades your build system and makes use of non-standard language features. wxWidgets does not extend the C++ language and as such might be less intrusive to the build system or less surprising to developers expecting standard C++.
- Qt has a full-featured embeddable GUI (Qt for Embedded Linux) based on GNU/Linux with framebuffer. This means that once you have Linux with /dev/fb you are ready to run examples with no additional pains. Qt for Embedded Linux has a small footprint compared with X11.
- There are numerous IDEs for Qt, QtDesigner, QtCreator, QDevelop, Edyuk as well as integrations with popular IDEs such as Visual Studio, Eclipse and XCode (though there are also several IDEs for wxWidgets).
- Qt offers reliable commercial support (but so does wx, see http://www.wxwidgets.org/support/support.htm)
- There has been a bunch of work done with the goal of a Qt-based port of wxWidgets (see the wxWidgets SVN wxQt branch), so wxWidgets applications aren't required to use GTK-Qt (which hasn't been known to work too well) to build applications that look and feel native for KDE users.
FLTK
- FLTK website: http://www.fltk.org/
- wxWidgets has a more mature OO design.
- FLTK is more light-weight, whereas wxWidgets is more full-featured (wxWidgets supports networking, printing, etc. while FLTK has limited or no support for these things). See wxWidgets Feature List (http://www.wxwidgets.org/about/feature2.htm) vs. FLTK Feature List (http://www.fltk.org/documentation.php/doc-1.1/intro.html#2_2).
- FLTK actually has more elaborate, different widget types. Just compare what you can do in FLUID to wxDesigner or DialogEdit. I ported a FLTK app to wxWidgets and had a hard time emulating the buttons.
- FLTK's modified LGPL license is more restricting than wxWidgets license, although it does provide exceptions for static linking.
- Light IDE called FLUID for GUI design (http://www.fltk.org/documentation.php/doc-1.1/fluid.html).
FOX
- FOX website: http://www.fox-toolkit.org/
- FOX is more light-weight, whereas wxWidgets is more full-featured.
- wxWidgets has a more complete API, while FOX focuses mainly on GUI features.
- FOX draws its own widgets on each platform, instead of using the native widgets (like Qt), whereas wxWidgets offers true native ports for all the supported platforms. FOX may be faster because of this, but the provided look-and-feel may not be well integrated into the target platform (e.g. the Windows XP theme is not currently available).
- FOX lacks printing and I18N support for asian language (it's using UTF-8 internally).
- Standard Windows dialog boxes are not supported in FOX, but a portable similar feature is available.
Java GUI toolkits
- Java is a programming language that can be combined with different GUI toolkits, such as
- wxWidgets is compiled to machine code. So is SWT, Swing and Qt. However, the rest of the applications code can be, for wxWidgets, compiled to machine code, whereas in Java applications, it will be interpreted code. However, SWT also has C++ binding today.
- There are mixed claims about performance (speed) of Java applications. Java applications usually use more memory than C/C++ applications.
- Users of Java-based applications must have a JVM installed. In recent years, this has become less of an issue as more computers are being installed with a JVM. However, users that have an older JVM may suffer from performance/security problems.
- wx4j is a wxWidgets implementation for Java. wx4j is a wxWidgets binding for Java which allows Java programmers to keep their Java language but still have the speed of a C++ written program.
- wxWidgets can be used by a large number of programming languages, and integrated easily. Java GUI toolkits can be used only by programming languages in the JVM (such as Java, JRuby, Jython, JavaScript, BeanShell).
- Java programs can be deployed easily via Webstart, allowing users to try out applications (see http://jabref.sourceforge.net/ for instance).
The following claims need to be made more specific: Which Java GUI Toolkit is discussed here?
- In order to be cross-platform, Java generally targets the least common denominator. Features that are only available or relevant on one platform but not others are left out of the Java APIs. Examples include manipulating the Windows taskbar, the Mac OS menu bar, Unix file attributes, etc.
- A corollary of the statement above: in a wxWidgets program, you can always write some platform-specific code where necessary, inside of an ifdef that makes it only compile on that one platform. In Java, there's no equivalent of an ifdef, and you have to jump through hoops to access external APIs. Also, wxWidgets emulates certain features that are not avalible on different platforms (such as MDI and tree controls).
SDL
- http://www.libsdl.org
- SDL (Simple DirectMedia Layer) is a multimedia C library more suited for when you're writing games and such, and want custom-everything and no convenient general-purpose UI elements. It is made of a lot of C structures starting with SDL_.
- It is possible to combine using wxWidgets and SDL: http://code.technoplaza.net/wx-sdl/
- Under the LGPL version 2.
- Allows only a single window to be opened.
- Very nice OpenGL integration (or libs that build on OpenGL e.g. OpenSceneGraph, CEGUI)
SFML
- http://sfml.sourceforge.net/index.php
- SFML (Simple and Fast Multimedia Library) is a multimedia C++ library more suited for when you're writing games and such and want custom-everything and no convenient general-purpose UI elements
- It covers a lot of things like : audio, network or threads ...
- It is possible to combine using wxWidgets, Qt, X11, etc.
Allegro
- http://alleg.sourceforge.net
- Much like SDL, Allegro is a cross-platform c library (with quite a bit of assembly used in the backend) for programming games.
- Almost as old as wxWidgets (circa 1993).
- Giftware license (essentially public domain).
- Requires gcc and an assembler to build.
- Development has been stuck in the same version for years, there are a lack of core developers (original developer is no longer on the team), and there are some internal disputes which may lead to a fork.
- Very basic GUI functionality - only supports one window with only bare bones operations supported - you can't move the window, etc.
- "Controls" are sort of supported in allegro also through functions with (many) variable-length arguments, and are owner drawn much like QT (but don't look as good by default). They can be customized via a relatively easy API (and there are a few sub libraries that already have somewhat fair-looking versions).
- Drawing routines are much faster than wx, and there is a opengl layer (allegrogl - http://allegrogl.sourceforge.net/) that makes drawing with opengl even easier than it is to begin with.
- Non-GUI routines (input, etc.) are lower-level and generally faster than wxWidgets' native implementations.
- Can be used with wxWidgets without too much trouble - since allegro has some platform specific functions to get the window handle, you can create a wxWidgets window from the window handle and do what you want from that from that point on. While wxWindows uses a wxApp to handle platform-specific main/WinMain stuff, Allegro requres you put END_OF_MAIN() after your main function - getting the two to work together is somewhat of a task, but not a very large one.
GTK+
- http://www.gtk.org
- GTK+, originally the Gimp toolkit, is a LGPL C-language GUI library for Unix systems.
- It has been ported to Windows, VMS, and other systems (MacOS X currently possible through Apple's X11.app, native version in development; both are painful to build and especially to package) using the same API. However, primary development and focus is for Unix, with multi-platform development mostly as an afterthought.
- GTK+ is the primary library used to construct user interfaces in GNOME.
- Unlike wxWidgets, GTK+ supports C (and there is a C++ wrapper called GTKMM, http://www.gtkmm.org )
- It's built on top of glib, a general-purpose library (similar in some ways to the C++ STL -- it provides a few data structures, functions to help memory management, etc).
- It looks and behaves exactly the same on all platforms (unless themes are used). On Windows, it has the ability to get the native appearance with the Wimp theme, which uses UxTheme.
- Does not use system provided widgets on Windows, but emulates it with themes.
Kylix
- Kylix hasn't been much of a success for Borland/Inprise, so it's doubtful how long it will be continued to be supported.
- Kylix is based on Qt, see above :)
- Fewer platforms are supported by Kylix
- The IDE, being based on no less than 3 toolkits, is rather unprofessional.
Lazarus
- Lazarus is a cross-platform and open source RAD IDE, and a library to write GUI software
- Lazarus is mostly compatible with Borland Delphi and the same code can be compiled with both
- Lazarus has data aware components for easy local and client server database applications development
- It only supports variety of (Object) Pascal dialects for language
- Working in a similar way to wxWidgets, it has support for many underlying widgetsets: gtk1, gtk2, win32api, qt, carbon and winCEapi. Cocoa and an owner drawn widgetset exist(fpgui), but are less progressed.
- The underlying Free Pascal Compiler supports most OSes and architectures currently in use
- Currently it supports fewer platforms than wxWidgets
- The combined Lazarus/FPC project contains nearly a complete deeply integrated toolchain in one project. RAD/IDE, compiler, libraries, XML bindings, database connectivity,
- Lazarus is slowly getting supported by the Borland/Embarcadero Delphi component market, providing complex and high quality commercial widgets.
Ultimate++
- Ultimate++ only supports Windows and Linux, not MacOS
- The comparision on http://upp.sourceforge.net/www$uppweb$vswx$en-us.html is a small example that doesn't show how the toolkit scales to bigger applications.
Notus
- See: http://sourceforge.net/projects/notus
- wxWidgets actually exists ;)
- notus is likely to make a lot more use of standard library and modern C++ concepts, such as iterators, templates, namespaces, etc (whereas wxWidgets reimplements or works around many of these things in non-standard ways); and it's also likely to follow the design principles of Boost (which you could consider either a good or bad thing), and work well with the rest of the Boost library. Of course, since it doesn't yet exist(*still* in alpha stage), whether this is true in practice remains to be seen.
MFC
- MFC is only available for free for Windows
- A macintosh version was available with Visual C++ Crossplatform Edition (~$800 at last check) but has not been supported by the compiler since version 4.1.
- There are also UNIX variants such as MainWin, which are extremely expensive, require runtime licenses, and are reported to have problematic support
- While the source for both wxWidgets and MFC is available, EULAs are not a concern with wxWidgets.
- MFC has a smaller executable size than wx (generally irrelevant with a decent compiler).
- MFC has greater range of good quality commercial components.
- Some say event tables (wxWidgets) are 'better' than message maps (MFC).
- wx's class hierarchy is more intuitive, while MFC tends to be more consistent among top-level class names.
- wx provides a far greater abundance of convenience classes, while MFC provides more windows-specific classes.
- .NET isn't an issue - MFC won't be ported to .NET. On the other hand, wx already has .NET wrappers in alpha stage!
- MFC has a broader range of components available, especially data-bound controls.
- Some things are easier with wxWidgets, such as certain types of windows (always on top, etc.), while other things are easier with MFC, such as detachable toolbars.
- Probably the strongest point to use MFC is MSVC, the IDE, itself.
- For info on class names and other points, see WxWidgets For MFC Programmers
XUL Framework (Mozilla)
- See: https://developer.mozilla.org/en/XUL
- JavaScript, XUL and CSS are all needed to program in Mozilla -- XUL describes the structure (like HTML in Web documents, JavaScript the behaviour, CSS for styling); wxWidgets does all of this in C++.
- Accessing XUL with C++ (XPCOM) is very difficult; C++ in wxWidgets is easier.
Tk
- Tk is a GUI toolkit designed for the Tcl scripting language and is best used with this language. See: http://wiki.tcl.tk for more information.
- There are bindings for other languages like Python, Perl, Ruby and C++.
- The core of Tk has few widgets, but several extensions are available. For example: BWidgets. There are extensions written in C or pure Tcl.
- Before 8.5 version Tk looked outdated. Now it has been solved on Windows and Mac OS X with the tile extension and it has been added to Tk 8.5 core as ttk. It has now native look on those platforms. On Linux though it still has the old look. This is work in progress, since they're creating themes for GTK and Qt. You can still use other themes to make it look better though.
- Tk is the default GUI toolkit for Python. The binding is called Tkinter. See: http://wiki.python.org/moin/TkInter
- Tk has a powerful canvas widget that allows you to draw anything and even create custom widgets.
- Tk has a powerful event system.
- Tk is used by several programmers without the need for a GUI designer since the API is simple and GUI code usually is shorter. Several GUI designers exist though. A window with a "Hello world!" on it is a one liner: pack [ttk::label -text "Hello world!"]
- A complete GUI program developed in Tcl/Tk can be wrapped in a single binary file (that's about 1 mb) called Starpack and deployed to all major platforms. See http://equi4.com/tclkit/ for more information.
- Tk has a very liberal BSD license that allows commercial software development.
Why you should use Tk? If you want a free, mature, stable, cross-platform GUI toolkit and you're using a scripting language.
Why you shouldn't use Tk? If you plan on using C++ or require a bigger default widget set it's better to use WxWidgets.
VCF
- See: http://vcf-online.org/ or http://sf.net/projects/vcf
- Clean OO design
- Mature on Windows, some support for MacOSX and Linux
- BSD licensing
WideStudio
- See: http://www.widestudio.org/
- WideStudio uses its own widgets
- WideStudio installation comes in a bundle with MinGW and gcc (not optional)
- WideStudio comes with an IDE/Designer
- There is an IDE/Designer plugin project (Native Application Builder) for Eclipse (see: http://www.eclipse.org/dsdp/nab/)
- WideStudio does not have keyboard-navigation through controls integrated
- WideStudio container classes do not allow referencing by name (myWindow("labelCaption")->Test)
- WideStudio libraries are less than 10MB total (2008-01-25) and distribution bundles can be <4MB for small applications
Why You Shouldn't Use wxWidgets
- Lack of commercial GUI components for making nice GUI grids, charts, etc. Look at wxCode though.
- No support for themes (apart from using the themes of the underlying toolkit) unless you use wxUniversal or wxSkin
- wxX11 is sub-par compared to other toolkits and unstable. You should use the wxGTK port instead, which builds upon GTK instead of directly onto X11. wxX11 is mostly intended for embedded devices that don't have GTK.
- wxWidgets tries to support a very expansive feature set, and as a result, some lesser-used components of the toolkit are not as stable/reliable as commonly used components are. As with any open source toolkit, thorough testing is the best solution here.
- wxWidgets does not provide binaries for any system. You have to compile wxWidgets yourself. wxpack provides wxWidgets binaries for Windows, but you have to download an entire multi-hundred megabyte Development Kit to get them. However you can download the C++ IDE plus WxWidget by downloading WxDev which is relatively smaller. WxDev is supported for both C and C++.
- The use of native widgets makes it more likely that the same code will behave differently from platform to platform, and also makes it more likely that there will be platform-specific bugs.
wxWidgets与其它GUI工具库比较的更多相关文章
- wxWidgets与其他工具库的比较(上)
本文是在wxWidgets Wiki上面找到的一篇,对比了wxWidgets和其他一些界面工具的特点.看到很多朋友在网上询问这些库各自的特点,我想先把这篇文章翻译出来——毕竟这也算是一篇官方的文章,应 ...
- wxWidgets与其他工具库的比较(下)
2009-07-25 12:37:51 GTK+ ● GTK+的网站:www.gtk.org: ● GTK+原本是Gimp的一个工具库,是在LGPL协议下发布的Unix系统GU ...
- Python测试 ——开发工具库
Web UI测试自动化 splinter - web UI测试工具,基于selnium封装. selenium - web UI自动化测试. mechanize- Python中有状态的程序化Web浏 ...
- Python开发GUI工具介绍,实战:将图片转化为素描画!【华为云技术分享】
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/devcloud/article/detai ...
- Python开发GUI工具介绍,实战:将图片转化为素描画!
欢迎添加华为云小助手微信(微信号:HWCloud002 或 HWCloud003),输入关键字"加群",加入华为云线上技术讨论群:输入关键字"最新活动",获取华 ...
- python测试开发工具库汇总(转载)
Web UI测试自动化 splinter - web UI测试工具,基于selnium封装. selenium - web UI自动化测试. mechanize- Python中有状态的程序化Web浏 ...
- 25个Java机器学习工具&库--转载
本列表总结了25个Java机器学习工具&库: 1. Weka集成了数据挖掘工作的机器学习算法.这些算法可以直接应用于一个数据集上或者你可以自己编写代码来调用.Weka包括一系列的工具,如数据预 ...
- java25个Java机器学习工具&库
本列表总结了25个Java机器学习工具&库: 1. Weka集成了数据挖掘工作的机器学习算法.这些算法可以直接应用于一个数据集上或者你可以自己编写代码来调用.Weka包括一系列的工具,如数据预 ...
- Java第三方工具库/包汇总
一.科学计算或矩阵运算库 科学计算包: JMathLib是一个用于计算复杂数学表达式并能够图形化显示计算结果的Java开源类库.它是Matlab.Octave.FreeMat.Scilab的一个克隆, ...
随机推荐
- Linux上Simplescalar/ARM的安装和运行文档
本文是基于ARM的simplescalar在ubuntu下的安装说明 1.1 软件下载 *********************文件下载地址:http://yunpan.cn/cw2n7dAyfG ...
- select2 插件编辑时设置默认值
function htDate(selectCustomerId, val) { var customerId = selectCustomerId; var values = val; ajaxJs ...
- Django的下载安装以及实现一个简单示例
一.Django下载安装 Django下载链接 1. 下载Django: pip3 install django==1.11.9 (大的版本1.11不要错) 2.创建一个django proje ...
- spring4笔记----spring4设值注入
2个接口 package com.ij34.servce; public interface people { public void cut(); } package com.ij34.servce ...
- java生成UUID
UUID介绍: UUID(Universally Unique Identifier)全局唯一标识符,是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的.按照开放软件基金会(OSF) ...
- Error in Log_event::read_log_event(): 'Event too small', data_len: 0, event_type: 0
MySQL主从复制报错如下: 2018-04-11 09:11:16 2400 [Note] Slave SQL thread initialized, starting replication in ...
- margin的两个有趣现象:margin合并和margin塌陷
margin合并 当两个元素在垂直方向并列,分别设置margin值时会发生一个margin合并的现象 举个例子,有两个div,垂直并列,box1设置margin-bottom:20px,box2设置m ...
- Cs231n课堂内容记录-Lecture 3 最优化
Lecture 4 最优化 课程内容记录: (上)https://zhuanlan.zhihu.com/p/21360434?refer=intelligentunit (下)https://zhua ...
- [Hive_10] Hive 的分析函数
0. 说明 Hive 的分析函数 窗口函数 | 排名函数 | 最大值 | 分层次 | lead && lag 统计活跃用户 | cume_dist 1. 窗口函数(开窗函数) ove ...
- 排序算法之选择排序的思想以及Java实现
1 基本思想 选择排序的思想是,每一次从待排序的数据元素中选出最小(或最大)的一个元素,存放在序列的起始位置,直到全部待排序的数据元素排完. 2,算法的实现(Java) package Algorit ...