You can add a built-in web browser to your GTK program using the GTKMozEmbed widget. GTKMozEmbed is just like a cut-down version of Mozilla Firefox, and so pages displayed in a GTKMozEmbed widget should look identical to those displayed in Firefox.

Embedding a web browser is useful for such things as displaying documents, as well as for allowing users to browse the web. For example, Yelp (the GNOME help browser) uses an embedded browser to display help pages.

This example shows you how to create a very basic web browser. You may also be interested in a similar tutorial, Creating a GNOME Web Browser with Python.

Screenshot

Screenshot of the example code running under Ubuntu 7.10 (Gutsy Gibbon):

simple-web-browser.png

Example Code

Example Python code for creating a simple web browser:

   1 #!/usr/bin/env python
   2 
   3 import gtk