Chinaunix首页 | 论坛 | 博客
  • 博客访问: 592546
  • 博文数量: 207
  • 博客积分: 10128
  • 博客等级: 上将
  • 技术积分: 2440
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-10 21:40
文章分类

全部博文(207)

文章存档

2009年(200)

2008年(7)

我的朋友

分类:

2009-04-29 13:45:22

In this post I'll review several frameworks used for creating graphical user interfaces. I've decided to create such a review after noticing many programmers take a specific GUI framework for granted, as it is their automatic-choice-by-tool (i.e., they use what they're IDE let them, barely understanding the layers required to develop such a framework, and that there are alternatives they might have chosen if they had knew about).

Windows.Forms

Naturally the automatic choice for anyone who builds a GUI in .Net. The first version was there from the very first .Net release, and supported by all versions of Visual Studio, the main IDE for .Net development.
When you ask most .Net developers what are they are using to build forms for their applications, they will most likely say "The default thing that comes with Visual Studio" or "... with .Net". Most won't even know other UI frameworks exist.
And for some technicalities: Windows.Forms in its original implementation wraps the underlying Windows native controls. In its second version, some controls where added that doesn't wrap any base controls, but rather implemented the entire logic and graphics internally in C#.
As most .Net frameworks, their immediate audience is the Windows users (or in this case - developers). However, the project had implemented all the Windows.Forms controls entirely in C#, not wrapping anything at all, while maintaining complete API compatibility (including message loop interference). Due to the nature of .Net binaries, this allows migration of compiled applications from .Net to Mono, hence from Windows to Linux.

WPF (+Silverlight)

The newest technology reviewed in this list. Has not yet become a natural choice of any developer (mainly due to the lack of tools and IDE integration), but it is getting there. Unlike any other framework listed here, this framework does not base on the underlying windowing system at all. The only use it has for the windowing system is to open and register a top-level window. From now on it is all DirectX (at least in the WPF implementation).
Using XAML as the main form of defining UI, and tools that resemble artistic programs more than IDEs, WPF really allows developers and designers to work together, letting each one focus on what he can do best, providing better separation between the two worlds. Also, it allows to create applications that are much more appealing visually than most common applications.
WPF stands for “Windows Presentation Foundation” and was introduced with .Net framework 3.0.
is a subset of WPF, targeting the web. Allowing roughly the same features as WPF, in the same development model, using the same tools, it bridges the gap for developers and designers to move from desktop to web environment and vice-versa, allowing knowledge and components to be persisted and reused.
is an open-source implementation of Silverlight, part of the project, aims to bring Silverlight to the Linux world.

The automatic choice for anyone who develops applications for the Linux desktop. Written in C, and have many language bindings, including C#.
GTK was originally developed to support the development of (the GNU Image Manipulation Program), thus was named “GIMP Tool Kit” – or GTK for short. Later on it became the main toolkit for the entire Linux desktop project.
This is an open-source (LGPL) library, developed and maintained by the community.
GTK is a source-code-compatible, cross-platform toolkit, that has binary distributions for Linux, Windows, and Mac OS, and has some support for mobile devices as well (it runs on some Nokia smart phones, and used to build the project and the project user interfaces).
It supports several levels of themes (Skins and Theme Engines), and has default themes for each operating system, especially for the Windows and Mac OS, that have very specific themes. This allows GTK applications to merge in the look and feel of those operating systems.

Originally developed by TrollTech, now owned by Nokia and supported by the community. Written in C++ and utilizing a Meta-Object-Compiler - a special precompiler that adds several features to the C++ language, mainly used for easier data binding. Some language bindings are available, including a community binding for C#, named .
QT is a cross platform framework targeting both Desktop and Mobile applications.
In its open-source license (GPL, LGPL) it is used to develop the Linux desktop environment, while in its commercial license it is used by commercial software and hardware vendors to build the GUI of their products.
QT has a very good support for themes, allowing it to merge in the look and feel of just about any environment, including Windows, Mac OS, and even the Gnome Linux desktop (by reading the Gnome theme configuration file).

wxWidgets is a cross-platform framework designed to use each system’s native controls to the max, while preserving common API and rich set of controls. Written in C++ and has several language bindings including C#.
There are no common tools that support visual design for it, but there are several visual designers for it out there, such as “”.

AWT

The Java most basic set of UI controls. AWT stands for “Abstract Windowing Toolkit”, and works in the same manner as .Net's Windows.Forms, but implemented differently on each JVM (i.e., wraps each system's native controls - The native Windows controls on Windows, usually GTK on Linux, and Cocoa on the Mac.)

Swing

Swing is Java’s themable UI framework, written completely in Java, using AWT’s most basic controls only, and built from scratch on top of than.
While this allows much nicer look and feels, Swing came too early and suffered from bad performance caused by the need to draw heavy graphics using a virtual machine on computers not strong enough at the time. This caused many developers to look for alternatives, and SWT was the most common one.

SWT

This one can be compared to the second version of Windows.Forms, or to wxWidgets, if you'd like. Based on each JVM implementation of AWT, makes a so called "Mix and Match" to create a better set of controls, that can run on each operating system and gains its native look and feel, while bringing large set of controls and maintaining performance by using the operating systems native controls.

X/XT/Motif

The 'X' Windowing System is the service that bring graphics and windowing operations to the Unix world. Like most windowing systems, this system is also based on a message loop and message dispatching, where each control is usually a window.
The X-Toolkit (XT) is a library helping to develop controls. It separates the control logic and design from the need to handle all the events passed to it from 'X', thus allowing vendors to focus on developing the controls themselves. Over time this approach has failed to persist, as no new control sets where created after Motif, and newer GUI frameworks (toolkits) had chosen to handle all events themselves, which also helped building cross-platform GUI frameworks.
Motif is the most commonly used set of controls that was build for the X-Toolkit framework, allowing large variety of controls for different aspects of GUI development.
阅读(797) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~