Introduction to wxWidgets

This tutorial will introduce you to the programming with the wxWidgets toolkit.


wxWidgets is a Graphical User Interface (GUI) toolkit for creating C++ applications. It is an open source, mature, and cross-platform toolkit. wxWidgets applications run on all major OS platforms, including Windows, Unix, and Mac OS. The project was started by Julian Smart in 1992. wxWidgets is much more than a toolkit. It provides a large variety of classes for handling streams, databases, threads, online help, or application settings. wxWidgets consists of a large group of widgets. The community around wxWidgets is grouped around their website.

The C++ programming language

The C++ programming language is one of the most widely used programming languages. It is used in many famous desktop applications like MS Office, Macromedia Flash, Firefox, Photoshop or 3D Max. C++ dominates also the world of PC games. It is one of the most difficult programming languages. On the other hand, programming in C++ today is different from programming 10 years ago. There are many tools and libraries that make the programming easier.

Programming languages

There are currently several widely used programming languages. The following list is based on the TIOBE Programming Community Index. The numbers are from September 2017. As we can see, C++ still belongs to the most popular programming languages in the world.

Position Language Ratings
8Visual Basic .NET1.98%

Java is the most widely used programming language. Java excels in creating portable mobile applications, programming various appliances and in creating enterprise applications. Every fourth application is programmed in C/C++. They are standard for creating operating systems and various desktop applications. C/C++ are the most widely used system programming languages.

C# is the main programming language of the Microsoft .NET platform.

PHP dominates over the Web. While Java is used mainly by large organisations, PHP is used by smaller companies and individuals. PHP is used to create dynamic web applications.

Visual Basic .NET is another popular .NET programming language. It represents the popularity of the RAD (Rapid Application Development).

Perl, Python, and Ruby are the most widely used scripting languages. They share many similarities. They are close competitors.

Multiplatform programming

Today, multiplatform programming is a buzzword. Most languages and libraries want to be multiplatform. wxWidgets was created as a multiplatform tool from the beginning. Most developers choose among these options. If it is possible, they go to the web. Or they can use Qt, wxWidgets, Swing, or SWT. The Qt library is the closest competitor to wxWidgets.

Installing wxWidgets

The following instructions are valid for Debian-based Linux.

$ sudo apt-get install build-essential

If we do not have a C++ compiler yet, we install the build-essential package.

$ sudo apt-get install libwxgtk3.0-dev

This installs the wxWidgets package.

This was an introduction to wxWidgets.