Examples

Explore some live examples of Wt below.

The source code of these (and many more) examples is included in the Wt source distribution. You may also browse through the source code of each example using the source code viewer, following the link below each example.

Cross-linked source code for these examples is also in doxygen documentation (in a new window).

Hangman

Run example

This example implements a simple well-known game, including a user ranking system, which is persisted to a database using Wt::Dbo.

Some of the things illustrated in this example:

  • Different approaches to layout: using an HTML template, a layout manager, or by compositing basic widgets and CSS.
  • Using hidden content to optimize the user experience by preloading contents, used in this game to preload the various images used to show the hanging man.
  • Navigation is implemented using WAnchor which reference an internal path. Action is taken by reacting to internal path changes.
  • The example uses the authentication module (Wt::Auth) to authenticate users using a username/password, or using Google's beta OAuth 2.0 service.
  • A database which contains user information is accessed and updated using Wt::Dbo.
Browse the source code