A Python native, OS native GUI toolkit.
Project description
A Python native, OS native GUI toolkit.
Quickstart
To get a demonstration of the capabilities of Toga, run the following:
$ pip install toga-demo $ toga-demo
This will pop up a GUI window with some sample widgets.
Prerequisites
Toga has some minimum requirements:
If you’re on macOS, you need to be on 10.7 (Lion) or newer.
If you’re on Linux, you need to have GTK+ 3.4 or later. This is the version that ships starting with Ubuntu 12.04 and Fedora 17.
If you want to use the WebView widget, you’ll also need to have WebKit, plus the GI bindings to WebKit installed.
For Ubuntu that’s provided by the (libwebkitgtk-3.0-0) and (gir1.2-webkit-3.0) packages.
For Fedora it’s all provided in the (webkitgtk3) package.
If these requirements aren’t met, Toga either won’t work at all, or won’t have full functionality.
Problems with source installs
Internally, Toga is comprised of a number of subpackages - one for each platform it supports. If you install using wheels, the install process will correctly identify the required packages and install them. However, if you install from source using pip, there is a known bug in pip that causes dependencies to not be installed. It may be necessary to manually install the following pre-requisites:
OS X: pip install toga-cocoa colosseum rubicon-objc
Linux: pip install toga-gtk colosseum
Win32: pip install toga-win32 colosseum
Problems using virtualenv under Linux
When running under Linux, Toga uses the system native python GTK+3 bindings for display purposes. However, if you’re using a --no-site-packages virtualenv (which is the default), the Python bindings for GTK won’t be in your PYTHONPATH.
If you install Toga in a virtual environment, Toga will attempt to automatically fix the problem; however, if this fails, you’ll need to apply the fix manually. To make the system GTK+ bindings available to your virtualenv, symlink the gi module from the system dist-packages directory into your virtualenv’s site-packages:
For an Ubuntu 14.04 system:: $ cd $VIRTUAL_ENV/lib/python3.4/site-packages $ ln -si /usr/lib/python3/dist-packages/gi For a Ubuntu 16.04 system:: $ cd $VIRTUAL_ENV/lib/python3.5/site-packages $ ln -si /usr/lib/python3/dist-packages/gi For a Fedora 64bit system:: $ cd $VIRTUAL_ENV/lib/python3.5/site-packages $ ln -si /usr/lib64/python3.5/site-packages/gi/
Documentation
Documentation for Toga can be found on Read The Docs.
Community
Toga is part of the BeeWare suite. You can talk to the community through:
The BeeWare Users Mailing list, for questions about how to use the BeeWare suite.
The BeeWare Developers Mailing list, for discussing the development of new features in the BeeWare suite, and ideas for new tools for the suite.
Contributing
If you experience problems with Toga, log them on GitHub. If you want to contribute code, please fork the code and submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.