others. wxWidgets encompasses the whole spectrum of users, from single
developer software outfits to large corporations,from computer science depart-
ments to medical research groups,and from ecological research to the telecom-
munications industry. It’s also used by a myriad of open source projects, such
as the Audacity audio editor and the pgAdmin III database design and man-
People use wxWidgets for many different reasons, whether simply as an
elegant MFC replacement on a single platform, or to allow them to move
easily from (say) Microsoft Windows to Unix and Mac OS X. wxWidgets is
addressing the challenges of mobile platforms, too, with ports for embedded
Linux,Microsoft Pocket PC, and (soon) Palm OS.
ISTORY OF WX
The wxWidgets project started life in 1992 when Julian Smart was working at
the University of Edinburgh on a diagramming tool called Hardy. He didn’t
want to choose between deploying it either on Sun workstations or PCs, so he
decided to use a cross-platform framework. Because the range of existing
cross-platform frameworks was limited, and the department didn’t have a
budget for it anyway, there was little choice but to write his own. The univer-
sity gave him permission to upload wxWidgets 1.0 to the department’s FTP
site in September 1992, and other developers began to use the code. Initially,
wxWidgets targeted XView and MFC 1.0; Borland C++ users complained
about the requirement for MFC, so it was rewritten to use pure Win32.
Because XView was giving way to Motif, a Motif port quickly followed.
Over time, a small but enthusiastic community of wxWidgets users was
established and a mailing list created. Contributions and fixes were sent in,
including an Xt port by Markus Holzem. wxWidgets gradually picked up more
and more users from all over the world: individuals, academics, government
departments, and—most gratifying of all—corporate users who found that
wxWidgets offered a better product and better support than the commercial
products they had looked at or used.
In 1997, a new wxWidgets 2 API was designed with help from Markus
Holzem.Wolfram Gloger suggested that wxWidgets should be ported to GTK+,
the up-and-coming widget set being adopted for the GNOME desktop environ-
ment. Robert Roebling became the lead developer for wxGTK, which is now
the main Unix/Linux port of wxWidgets. In 1998, the Windows and GTK+
ports were merged and put under CVS control. Vadim Zeitlin joined the proj-
ect to contribute huge amounts of design and code, and Stefan Csomor started
a Mac OS port, also in 1998.
1999 saw the addition of Vaclav Slavik’s impressive wxHTML classes
and the HTML-based help viewer. In 2000, SciTech, Inc. sponsored initial
development of wxUniversal,wxWidgets’s own set of widgets for use on platforms
A Brief History of wxWidgets
that have no widget set of their own. wxUniversal was first used in SciTech’s
port to MGL,their low-level graphics layer.
In 2002, Julian Smart and Robert Roebling added the wxX11 port using
the wxUniversal widgets. Requiring only Unix and X11, wxX11 is suitable for
any Unix environment and can be used in fairly low-spec systems.
In July 2003, wxWidgets started running on Windows CE, and Robert
Roebling demonstrated wxGTK applications running on the GPE embedded
In 2004,wxWidgets was renamed from the original moniker “wxWindows,”
after objections from Microsoft based on its Windows trademark.
Also during 2004,Stefan Csomor and a host of other contributors completely
revamped wxMac for OS X, significantly improving the appearance and function-
ality of OS X applications. A port using Cocoa was also steadily improved, led by
David Elliot, and William Osborne won our challenge to deliver an embryonic
Palm OS 6 port that supports the wxWidgets “minimal” sample.Version 2.6 was
released in April 2005,incorporating major improvements to all ports.
Future plans for wxWidgets include
A package management tool, to make it easier to integrate third-party
Improved support for embedded applications
Alternative event handling mechanisms
Enhanced controls, such as a combined tree and list control
wxHTML 2, with full web capabilities on all platforms
Further compatibility with standards such as STL
A full Palm OS port
The wxWidgets community is a vibrant one, with two mailing lists: wx-users
(for users) and wx-dev (for contributors). The web site has news, articles, and
links to releases, and there is also the wxWidgets “Wiki,” a set of web pages
where everyone can add information. A forum is also available for developers
and users alike. Here’s a list of the web addresses for these resources:
:the wxWidgets home page
:the mailing list archives
:the wxWidgets Wiki
:the wxWidgets forum
As with most open source projects, wxWidgets is developed using a CVS
repository, a source management system that keeps track of code history. In
order to prevent a chaotic free-for-all, a small number of developers have write
Introduction Chapter 1
access to CVS, and others can contribute by posting bug reports and patches
(currently handled by SourceForge’s trackers). Development occurs on two
main branches: the “stable” branch, where only binary-compatible bug fixes
are allowed, and the “development” branch (CVS head). So-called stable
releases are even-numbered (for example, 2.4.x) and development releases are
odd-numbered (for example, 2.5.x). Users can wait for new releases or down-
load the source from the appropriate branch by anonymous CVS.
Decisions about API changes and other technical issues are made by con-
sensus, usually by discussion on the wx-dev list.As well as the main wxWidgets
community, many projects have spun off and enjoy their own communities—
for example wxPython and wxPerl (see Appendix E, “Third-Party Tools for
Like all modern GUI frameworks, wxWidgets benefits from heavy use of object-
oriented programming concepts. Each window is represented as a C++ object;
these objects have well-defined behavior, and can receive and react to events.
What the user sees is the visual manifestation of this interacting system of
objects.Your job as a developer is to orchestrate these objects’ collective behavior,
a task made easier by the default behaviors that wxWidgets implements for you.
Of course, it’s no coincidence that object-oriented programming and GUIs
mesh well—they grew up together. The object-oriented language Smalltalk
designed by Alan Kay and others in the 1970s was an important milestone in
GUI history, making innovations in user interface technology as well as lan-
guage design, and although wxWidgets uses a different language and API, the
principles employed are broadly the same.
The wxWidgets license (officially, the “wxWindows License” for legal and his-
torical reasons) is L-GPL with an exception clause. You can read the license
files in detail on the web site or in the
directory of the distribution, but in
summary, you can use wxWidgets for commercial or free software with no roy-
alty charge.You can link statically or dynamically to the wxWidgets library. If
you make changes to the wxWidgets source code, you are obliged to make these
freely available. You do not have to make your own source code or object files
available. Please also consult the licenses for the optional subordinate
libraries that are distributed with wxWidgets, such as the PNG and JPEG
The source code that accompanies this book is provided under the
Table 1-1 shows the four conceptual layers: the wxWidgets public API, each
major port, the platform API used by that port, and finally the underlying
Introduction Chapter 1
Table 1-1 wxWidgets Ports
Mac OS 9/
Mac OS X
Mac OS X
The following are the main wxWidgets ports that exist at the time of
This port compiles and runs on all 32-bit and 64-bit variants of the Microsoft
Windows operating system, including Windows 95, Windows 98, Windows ME,
Windows NT, Windows 2000, Windows XP and Windows 2003. It can also be
compiled to use Winelib under Linux, and has a configuration that works on
Windows CE (see “wxWinCE”). wxMSW can be configured to use the
wxUniversal widgets instead of the regular Win32 ones.
wxWidgets for GTK+ can use versions 1.x or 2.x of the GTK+ widget set, on
any Unix variant that supports X11 and GTK+ (for example, Linux, Solaris,
HP-UX,IRIX, FreeBSD,OpenBSD,AIX,and others). It can also run on embed-
ded platforms with sufficient resources—for example, under the GPE Palmtop
Environment (see Figure 1-4). wxGTK is the recommended port for Unix-
C# Word - Word Conversion in C#.NET
without using other external third-party dependencies like Adobe Acrobat. document, including Jpeg, Png, Bmp, Gif images, .NET Graphics PDF to Word Conversion. extract jpg from pdf; extract images from pdf acrobat
The wxWidgets Architecture
Figure 1-4 The wxWidgets “Life!” demo under GPE on an iPAQ PDA
wxWidgets for X11 uses the wxUniversal widget set and runs directly on Xlib
with no native widget set.This makes the port suitable for embedded systems,
but it can also be used for desktop applications where it is undesirable to link
with GTK+.This is supported on any Unix system running X11. wxX11 is not
as mature as the wxGTK port.Figure 1-5 shows the Life! demo compiled under
wxX11 and running on Familiar Linux / TinyX on an iPAQ PDA.
Figure 1-5 The wxWidgets “Life!” demo running on embedded wxX11
C# Excel - Excel Conversion & Rendering in C#.NET
without using other external third-party dependencies like Adobe Acrobat. PPT) 2003, 2007 and above versions, raster images (Jpeg, Png Excel to PDF Conversion. extract pictures from pdf; extract jpeg from pdf
This port can use Motif, OpenMotif, or Lesstif on most Unix systems. Sun
Microsystems is putting its weight behind GNOME and GTK+, so Motif is no
longer an attractive option for most developers and users.
wxMac targets Mac OS 9 (from 9.1 upwards) and Mac OS X (from 10.2.8
upwards). For Mac OS 9 builds, you need the Metrowerks CodeWarrior tools,
and for Mac OS X, you can use either Metrowerks CodeWarrior or Apple tools.
When using Apple’s tools, you should use Xcode 1.5 or higher, or—if you are
just using command line tools—GCC 3.3 or higher.
A port in progress, this targets the Cocoa API of Mac OS X.Although the func-
tionality of Carbon and Cocoa is similar, this port has the potential for sup-
porting GNUStep running on platforms other than a Mac.
The Windows CE port encompasses various SDKs based on the Windows CE
platform, including Pocket PC and Smartphone.The bulk of this port consists
of the wxMSW Win32 port, with some omissions and additions for the smaller
platform. Figure 1-6 shows the wxWidgets Life! demo running on the Pocket
PC 2003 emulator. Figure 1-7 shows four screens from the wxWidgets dialog
demo running on Smartphone 2003 with a 176 × 220 pixel display. User inter-
face adaptations done by wxWidgets for this restricted platform include con-
structing a nested menu in place of the usual menu bar because Smartphone
only supports two menu buttons. Some additional application hints are
required, such as calling
instead of adding con-
ventional OK and Cancel buttons to a dialog.
Introduction Chapter 1
The wxWidgets Architecture
Figure 1-6 The wxWidgets “Life!” demo on Pocket PC 2003
Figure 1-7 The wxWidgets “dialogs”demo on Smartphone 2003
Introduction Chapter 1
Figure 1-8 A wxWidgets sample under Palm OS 6
This is a port to Palm OS 6 (Cobalt). At the time of writing, the port is in its
infancy but can be used to compile and run a simple sample in the Palm OS 6
simulator (see Figure 1-8).
wxOS2 is a Presentation Manager port for OS/2 or eComStation.
This port targets the MGL low-level graphics layer from SciTech Software,
Inc., and uses the wxUniversal widget set.
Internally, the wxWidgets code base is broadly separated into six layers:
1. Common code is used in all ports. It includes data structure classes,
run-time type information, and the base classes,such as wxWindowBase,
which are used to factor out code common to all implementations of a
2. Generic code implements advanced widgets independently of any plat-
form, allowing emulation of controls and other functionality not present
on a given platform.
are examples of generic
3. wxUniversal is a set of basic widgets for those platforms that do not
have their own native widget set, such as bare X11 and MGL.
4. Platform-specific code implements classes using native functionality.
An example of platform-specific code is the wxMSW implementation of
wrapping the Win32 edit control.
5. Contributed code exists in a separate hierarchy named
includes non-essential but useful classes such as
6. Third-party code comprises libraries that were developed independ-
ently of wxWidgets but are used to implement important features.
Examples of third-party code include the JPEG, Zlib, PNG, and Expat
Each port takes what it needs from these layers to implement the wxWidgets
How does wxWidgets know which classes to use when you’re compiling
your application? When you include a wxWidgets header file, such as
, you’re actually including a platform-specific file such as
,due to directives in
that conditionally include
the appropriate declarations. You then link your application against a library
that has been compiled with suitable settings for the platform in question.You
can have several configurations available at once, in particular Debug and
Release versions,and you can normally link either statically or dynamically to
the wxWidgets code. If you want, you can disable components in a wxWidgets
build,or make choices such as Unicode versus ANSI,by editing the file
or using configure options depending on compiler. For more details, please see
Appendix A,“Installing wxWidgets.”
Note that although wxWidgets is a wrapper around each native API, you
are not prevented from writing platform-specific code in that native API if you
need to, although this is seldom necessary.
In this chapter, we’ve established what wxWidgets is, described a little of its
history, summarized the available ports, and taken a brief look at how the
library is organized internally.
In the next chapter, “Getting Started,” we will look at some sample code
and get a feeling for what it’s like to write a wxWidgets application.
Documents you may be interested
Documents you may be interested