Note that along with the blank area (which is the actual GtkWindow) the window manger has has added the familiar title bar and hide,expand and close buttons. It simply creates a small window and waits for you to close it. Here is the traditional "Your first programme" which server as a test that all the required packages are installed and working correctly. Of every Python programme that uses GTK+3, but they will always be the same three lines ! import gi Just three lines of code are needed at the start Using GObject Introspection involves a slightly more complex process to import the required modules into your Python programme. Instructions for other Linux distributions and platforms can be found on the PyGObject web site Don't just import Gtk !
#Python gtk install
Sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0 On Debian based systems like Raspbian the installation is quite simple.
The case of Python by PyGObject Installing PyGObject UPDATE On current Raspbian (Full install) everything needed is already installed by default. The interface between GTK+3 and other languages is now provided by " GObject Introspection" and in NOTE: This is NOT a Python tutorial, it assumes you are already familiar with programming in Python.
Looked at using GTK+3 with Python, and quite a lot has changed. Some time ago I took a look at using GTK+2 with Python so I have also Recently (Early part of 2017) I have taken a long overdue step and started to migrate some of my C programmes from GTK+2 to GTK+3. Getting started with Python and GTK+3 Getting started using GTK+3 with Python.