[pygtk] Add 'import pygtk; pygtk.require('2.0') statements where needed



commit d82023765f874731214cfe9fcd53edb8734d234b
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue Feb 15 17:31:16 2011 +0100

    Add 'import pygtk; pygtk.require('2.0') statements where needed

 examples/atk/atk-demo.py                      |    2 ++
 examples/glade/autoconnect.py                 |    1 -
 examples/glade/glade-demo.py                  |    3 +++
 examples/gobject/editable-interface.py        |    2 ++
 examples/gobject/properties.py                |    2 ++
 examples/gobject/signal.py                    |    3 ++-
 examples/gtk/application.py                   |    2 ++
 examples/gtk/bin.py                           |    3 +++
 examples/gtk/customtreemodel.py               |    2 ++
 examples/gtk/mirror.py                        |    2 ++
 examples/gtk/scrollable.py                    |    2 ++
 examples/gtk/sizegroup.py                     |    2 ++
 examples/gtk/testprint.py                     |    3 +++
 examples/gtk/treeview_dnd.py                  |    2 ++
 examples/gtk/widget.py                        |    2 ++
 examples/ide/edit.py                          |    4 +++-
 examples/pango/pangocairo-simple.py           |    4 +++-
 examples/pango/utf8-demo.py                   |    2 ++
 examples/pygtk-demo/demos/appwindow.py        |    2 ++
 examples/pygtk-demo/demos/builder.py          |    2 ++
 examples/pygtk-demo/demos/buttonbox.py        |    2 ++
 examples/pygtk-demo/demos/changedisplay.py    |    2 ++
 examples/pygtk-demo/demos/colorsel.py         |    2 ++
 examples/pygtk-demo/demos/dialogs.py          |    2 ++
 examples/pygtk-demo/demos/dnd.py              |    2 ++
 examples/pygtk-demo/demos/editable_cells.py   |    2 ++
 examples/pygtk-demo/demos/entry_completion.py |    2 ++
 examples/pygtk-demo/demos/expander.py         |    2 ++
 examples/pygtk-demo/demos/hypertext.py        |    2 ++
 examples/pygtk-demo/demos/images.py           |    3 +++
 examples/pygtk-demo/demos/infobar.py          |    2 ++
 examples/pygtk-demo/demos/list_store.py       |    2 ++
 examples/pygtk-demo/demos/menu.py             |    2 ++
 examples/pygtk-demo/demos/panes.py            |    2 ++
 examples/pygtk-demo/demos/pixbufs.py          |    3 +++
 examples/pygtk-demo/demos/print_editor.py     |    3 +++
 examples/pygtk-demo/demos/sizegroup.py        |    2 ++
 examples/pygtk-demo/demos/spinner.py          |    2 ++
 examples/pygtk-demo/demos/statusicon.py       |    2 ++
 examples/pygtk-demo/demos/stock_browser.py    |    2 ++
 examples/pygtk-demo/demos/textscroll.py       |    2 ++
 examples/pygtk-demo/demos/textview.py         |    2 ++
 examples/pygtk-demo/demos/toolpalette.py      |    2 ++
 examples/pygtk-demo/demos/tooltip.py          |    2 ++
 examples/pygtk-demo/demos/tree_store.py       |    2 ++
 examples/pygtk-demo/demos/treemodel.py        |    2 ++
 examples/pygtk-demo/demos/ui_manager.py       |    2 ++
 examples/pygtk-demo/pygtk-demo.py             |    7 ++-----
 examples/simple/dnd.py                        |    2 ++
 examples/simple/hello.py                      |    2 ++
 examples/simple/scribble.py                   |    2 ++
 examples/simple/simple.py                     |    2 ++
 examples/simple/tooltip.py                    |    2 ++
 examples/threading/gtk_threading.py           |    2 ++
 setup.py                                      |    3 +++
 tests/common-windows.py                       |    2 ++
 tests/common.py                               |    2 ++
 57 files changed, 121 insertions(+), 9 deletions(-)
---
diff --git a/examples/atk/atk-demo.py b/examples/atk/atk-demo.py
index 238a00e..5e2268b 100644
--- a/examples/atk/atk-demo.py
+++ b/examples/atk/atk-demo.py
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import atk
 
diff --git a/examples/glade/autoconnect.py b/examples/glade/autoconnect.py
index 72b1f2a..651af39 100644
--- a/examples/glade/autoconnect.py
+++ b/examples/glade/autoconnect.py
@@ -5,7 +5,6 @@
 
 import pygtk
 pygtk.require('2.0')
-
 import gtk, gtk.glade
 
 class SimpleTest:
diff --git a/examples/glade/glade-demo.py b/examples/glade/glade-demo.py
index d67a586..efecb3d 100644
--- a/examples/glade/glade-demo.py
+++ b/examples/glade/glade-demo.py
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 import sys
+
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gtk.glade
 
diff --git a/examples/gobject/editable-interface.py b/examples/gobject/editable-interface.py
index 70ba1dc..409f986 100644
--- a/examples/gobject/editable-interface.py
+++ b/examples/gobject/editable-interface.py
@@ -1,3 +1,5 @@
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gobject
 
diff --git a/examples/gobject/properties.py b/examples/gobject/properties.py
index 2d36afc..a2d91ef 100644
--- a/examples/gobject/properties.py
+++ b/examples/gobject/properties.py
@@ -1,3 +1,5 @@
+import pygtk
+pygtk.require('2.0')
 import gobject
 
 class MyObject(gobject.GObject):
diff --git a/examples/gobject/signal.py b/examples/gobject/signal.py
index 26ddae9..1aaa352 100644
--- a/examples/gobject/signal.py
+++ b/examples/gobject/signal.py
@@ -1,4 +1,5 @@
-import pygtk; pygtk.require("2.0")
+import pygtk
+pygtk.require("2.0")
 import gobject
 
 class C(gobject.GObject):
diff --git a/examples/gtk/application.py b/examples/gtk/application.py
index 5d65428..02ea56f 100644
--- a/examples/gtk/application.py
+++ b/examples/gtk/application.py
@@ -1,5 +1,7 @@
 # By Jarek Zgoda and Johan Dahlin
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 ui_string = """<ui>
diff --git a/examples/gtk/bin.py b/examples/gtk/bin.py
index fa8d7af..407120d 100644
--- a/examples/gtk/bin.py
+++ b/examples/gtk/bin.py
@@ -1,4 +1,7 @@
 # A simple gtk.Conatiner subclassing example reimplementing gtk.Bin in python
+
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class Bin(gtk.Container):
diff --git a/examples/gtk/customtreemodel.py b/examples/gtk/customtreemodel.py
index 27335dc..739c301 100644
--- a/examples/gtk/customtreemodel.py
+++ b/examples/gtk/customtreemodel.py
@@ -3,6 +3,8 @@
 import sys
 import weakref
 
+import pygtk
+pygtk.require('2.0')
 import pango
 import gtk
 
diff --git a/examples/gtk/mirror.py b/examples/gtk/mirror.py
index 877b725..805a157 100644
--- a/examples/gtk/mirror.py
+++ b/examples/gtk/mirror.py
@@ -3,6 +3,8 @@
 # ctypes to wrap otherwise unexposed GObject API
 # John Stowers
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import cairo
 import gtk
diff --git a/examples/gtk/scrollable.py b/examples/gtk/scrollable.py
index 0a79246..5b1c3c5 100644
--- a/examples/gtk/scrollable.py
+++ b/examples/gtk/scrollable.py
@@ -6,6 +6,8 @@
 #
 # Requires PyGTK 2.8.0 or later
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 from gtk import gdk
diff --git a/examples/gtk/sizegroup.py b/examples/gtk/sizegroup.py
index a88308d..1065873 100644
--- a/examples/gtk/sizegroup.py
+++ b/examples/gtk/sizegroup.py
@@ -12,6 +12,8 @@ aligned vertically. We can accomplish this by adding a horizontal
 sizegroup to the labels.
 """
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 def create_label(text):
diff --git a/examples/gtk/testprint.py b/examples/gtk/testprint.py
index 06acf3f..fdaba2e 100644
--- a/examples/gtk/testprint.py
+++ b/examples/gtk/testprint.py
@@ -2,6 +2,9 @@
 
 import sys
 import math
+
+import pygtk
+pygtk.require('2.0')
 import cairo
 import pango
 import gtk
diff --git a/examples/gtk/treeview_dnd.py b/examples/gtk/treeview_dnd.py
index ba4d3a4..6005d8e 100644
--- a/examples/gtk/treeview_dnd.py
+++ b/examples/gtk/treeview_dnd.py
@@ -4,6 +4,8 @@
 # This file is based on http://code.google.com/p/quodlibet/source/browse/junk/dndtest.py
 
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/gtk/widget.py b/examples/gtk/widget.py
index 758fce4..5bbe88f 100644
--- a/examples/gtk/widget.py
+++ b/examples/gtk/widget.py
@@ -1,5 +1,7 @@
 import sys
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import pango
 import gtk
diff --git a/examples/ide/edit.py b/examples/ide/edit.py
index 6e34e8b..78e30df 100644
--- a/examples/ide/edit.py
+++ b/examples/ide/edit.py
@@ -3,9 +3,11 @@
 # This is a sample implementation of an editor.
 
 import os
-import dialogs
 
+import pygtk
+pygtk.require('2.0')
 import gtk
+import dialogs
 
 BLOCK_SIZE = 2048
 RESPONSE_FORWARD = 1
diff --git a/examples/pango/pangocairo-simple.py b/examples/pango/pangocairo-simple.py
index 8cf6d46..15d464c 100755
--- a/examples/pango/pangocairo-simple.py
+++ b/examples/pango/pangocairo-simple.py
@@ -1,8 +1,10 @@
 #! /usr/bin/env python
 import sys
 import math
-import pango
 import cairo
+import pygtk
+pygtk.require('2.0')
+import pango
 import pangocairo
 
 RADIUS = 150
diff --git a/examples/pango/utf8-demo.py b/examples/pango/utf8-demo.py
index 3b960e2..2d430a3 100755
--- a/examples/pango/utf8-demo.py
+++ b/examples/pango/utf8-demo.py
@@ -2,6 +2,8 @@
 # -*- coding: utf-8 -*-
 #
 # order is important here (for now)
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 # string taken from pango examples directory and converted from utf8
diff --git a/examples/pygtk-demo/demos/appwindow.py b/examples/pygtk-demo/demos/appwindow.py
index b29b63e..004fb3a 100644
--- a/examples/pygtk-demo/demos/appwindow.py
+++ b/examples/pygtk-demo/demos/appwindow.py
@@ -4,6 +4,8 @@
 Demonstrates a typical application window, with menubar, toolbar, statusbar.'''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/builder.py b/examples/pygtk-demo/demos/builder.py
index 5df9d10..b1b69fb 100644
--- a/examples/pygtk-demo/demos/builder.py
+++ b/examples/pygtk-demo/demos/builder.py
@@ -5,6 +5,8 @@ This is a test of the new gtk builder system.  It is a
 fairly straight forward port of the example distributed with gtk.
 '''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class BuilderDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/buttonbox.py b/examples/pygtk-demo/demos/buttonbox.py
index 91b434b..6060837 100644
--- a/examples/pygtk-demo/demos/buttonbox.py
+++ b/examples/pygtk-demo/demos/buttonbox.py
@@ -4,6 +4,8 @@
 This demo shows various button box configurations available.  It also
 uses stock buttons, and use of mnemonics for navigation.'''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 def create_bbox(horizontal=True, title=None, spacing=0,
diff --git a/examples/pygtk-demo/demos/changedisplay.py b/examples/pygtk-demo/demos/changedisplay.py
index 86d6556..a785a61 100644
--- a/examples/pygtk-demo/demos/changedisplay.py
+++ b/examples/pygtk-demo/demos/changedisplay.py
@@ -23,6 +23,8 @@ This is a moderately complex example, and demonstrates:
 - Using GtkListStore and GtkTreeView
 - Using GtkDialog
 '''
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gobject
 
diff --git a/examples/pygtk-demo/demos/colorsel.py b/examples/pygtk-demo/demos/colorsel.py
index 252d09c..14d3552 100644
--- a/examples/pygtk-demo/demos/colorsel.py
+++ b/examples/pygtk-demo/demos/colorsel.py
@@ -4,6 +4,8 @@
 GtkColorSelection lets the user choose a color. GtkColorSelectionDialog is a
 prebuilt dialog containing a GtkColorSelection."""
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class ColorSelectorDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/dialogs.py b/examples/pygtk-demo/demos/dialogs.py
index edea070..f4f8946 100644
--- a/examples/pygtk-demo/demos/dialogs.py
+++ b/examples/pygtk-demo/demos/dialogs.py
@@ -3,6 +3,8 @@
 
 Dialog widgets are used to pop up a transient window for user feedback."""
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class DialogAndMessageBoxesDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/dnd.py b/examples/pygtk-demo/demos/dnd.py
index ad6cf99..bc6f793 100644
--- a/examples/pygtk-demo/demos/dnd.py
+++ b/examples/pygtk-demo/demos/dnd.py
@@ -5,6 +5,8 @@ This is a test of the drag and drop capabilities of gtk.  It is a
 fairly straight forward port of the example distributed with gtk.
 '''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gobject
 
diff --git a/examples/pygtk-demo/demos/editable_cells.py b/examples/pygtk-demo/demos/editable_cells.py
index a0797ad..8a3e364 100644
--- a/examples/pygtk-demo/demos/editable_cells.py
+++ b/examples/pygtk-demo/demos/editable_cells.py
@@ -6,6 +6,8 @@ If you're new to the GtkTreeView widgets and associates, look into the
 GtkListStore example first.'''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/entry_completion.py b/examples/pygtk-demo/demos/entry_completion.py
index 71e094e..dcf25d5 100644
--- a/examples/pygtk-demo/demos/entry_completion.py
+++ b/examples/pygtk-demo/demos/entry_completion.py
@@ -6,6 +6,8 @@ completion in GtkEntry.
 '''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class EntryCompletionDemo(gtk.Dialog):
diff --git a/examples/pygtk-demo/demos/expander.py b/examples/pygtk-demo/demos/expander.py
index bb02b95..43c14a2 100644
--- a/examples/pygtk-demo/demos/expander.py
+++ b/examples/pygtk-demo/demos/expander.py
@@ -6,6 +6,8 @@ This is also known as "disclosure triangle".
 '''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class ExpanderDemo(gtk.Dialog):
diff --git a/examples/pygtk-demo/demos/hypertext.py b/examples/pygtk-demo/demos/hypertext.py
index b2efc63..e7143de 100644
--- a/examples/pygtk-demo/demos/hypertext.py
+++ b/examples/pygtk-demo/demos/hypertext.py
@@ -7,6 +7,8 @@ They can also affect the behavior of mouse and key presses, as this demo
 shows.'''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import pango
 
diff --git a/examples/pygtk-demo/demos/images.py b/examples/pygtk-demo/demos/images.py
index 176cfa7..3e2ff56 100644
--- a/examples/pygtk-demo/demos/images.py
+++ b/examples/pygtk-demo/demos/images.py
@@ -11,6 +11,9 @@ depend on loading external files, your application binary can be self-contained.
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
 import os
+
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/infobar.py b/examples/pygtk-demo/demos/infobar.py
index b4a5440..adfef16 100644
--- a/examples/pygtk-demo/demos/infobar.py
+++ b/examples/pygtk-demo/demos/infobar.py
@@ -6,6 +6,8 @@ dialog. It is often temporarily shown at the top or bottom of a document.
 '''
 # pygtk version: John Stowers <john stowers gmail com>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class InfoBarDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/list_store.py b/examples/pygtk-demo/demos/list_store.py
index 6273033..2c6e6e5 100644
--- a/examples/pygtk-demo/demos/list_store.py
+++ b/examples/pygtk-demo/demos/list_store.py
@@ -6,6 +6,8 @@ later on by a GtkTreeView to display it. This demo builds a
 simple GtkListStore and displays it. See the Stock Browser
 demo for a more advanced example.'''
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/menu.py b/examples/pygtk-demo/demos/menu.py
index 3a61a42..e229b8b 100644
--- a/examples/pygtk-demo/demos/menu.py
+++ b/examples/pygtk-demo/demos/menu.py
@@ -5,6 +5,8 @@ This example demonstrates the use of various menu types in gtk.  It
 demonstrates the new submenu navigation and scrolling menu features of
 gtk 2.0.'''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 def create_menu(depth, length=5):
diff --git a/examples/pygtk-demo/demos/panes.py b/examples/pygtk-demo/demos/panes.py
index 007ec07..8829547 100644
--- a/examples/pygtk-demo/demos/panes.py
+++ b/examples/pygtk-demo/demos/panes.py
@@ -8,6 +8,8 @@ There are a number of options that can be set for each pane. This test contains
 both a horizontal(HPaned) and a vertical(VPaned) widget, and allows you to
 adjust the options for each side of each widget."""
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class PanedWidgetsDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/pixbufs.py b/examples/pygtk-demo/demos/pixbufs.py
index 311f4f8..e707f7a 100644
--- a/examples/pygtk-demo/demos/pixbufs.py
+++ b/examples/pygtk-demo/demos/pixbufs.py
@@ -11,6 +11,9 @@ Look at the Image demo for additional pixbuf usage examples.'''
 
 import os
 import math
+
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/print_editor.py b/examples/pygtk-demo/demos/print_editor.py
index b360474..bbaf27b 100644
--- a/examples/pygtk-demo/demos/print_editor.py
+++ b/examples/pygtk-demo/demos/print_editor.py
@@ -3,6 +3,9 @@
 A small demo editor with printing support"""
 
 import sys
+
+import pygtk
+pygtk.require('2.0')
 import gobject
 import pango
 import gtk
diff --git a/examples/pygtk-demo/demos/sizegroup.py b/examples/pygtk-demo/demos/sizegroup.py
index a780390..38e3041 100644
--- a/examples/pygtk-demo/demos/sizegroup.py
+++ b/examples/pygtk-demo/demos/sizegroup.py
@@ -12,6 +12,8 @@ actually be the same size, you need to pack them in such a way that they get
 the size they request and not more. For example, if you are packing your
 widgets into a table, you would not include the GTK_FILL flag."""
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class SizeGroupDemo(gtk.Dialog):
diff --git a/examples/pygtk-demo/demos/spinner.py b/examples/pygtk-demo/demos/spinner.py
index 1011186..b47e306 100644
--- a/examples/pygtk-demo/demos/spinner.py
+++ b/examples/pygtk-demo/demos/spinner.py
@@ -5,6 +5,8 @@ GtkSpinner allows to show that background activity is on-going.
 """
 # pygtk version: John Stowers <john stowers gmail com>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class SpinnerDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/statusicon.py b/examples/pygtk-demo/demos/statusicon.py
index 53564a8..1fb7dfe 100644
--- a/examples/pygtk-demo/demos/statusicon.py
+++ b/examples/pygtk-demo/demos/statusicon.py
@@ -7,6 +7,8 @@ in Windows.
 '''
 ## Author: Nikos Kouremenos
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 
diff --git a/examples/pygtk-demo/demos/stock_browser.py b/examples/pygtk-demo/demos/stock_browser.py
index 1689230..7323ffd 100644
--- a/examples/pygtk-demo/demos/stock_browser.py
+++ b/examples/pygtk-demo/demos/stock_browser.py
@@ -7,6 +7,8 @@ handy place to browse the available stock icons and stock items.
 '''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 import re
diff --git a/examples/pygtk-demo/demos/textscroll.py b/examples/pygtk-demo/demos/textscroll.py
index aa59ca2..5b9a9d0 100644
--- a/examples/pygtk-demo/demos/textscroll.py
+++ b/examples/pygtk-demo/demos/textscroll.py
@@ -5,6 +5,8 @@ This example demonstrates how to use the gravity of
 GtkTextMarks to keep a text view scrolled to the bottom
 while appending text."""
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/textview.py b/examples/pygtk-demo/demos/textview.py
index 4416661..33a1c16 100644
--- a/examples/pygtk-demo/demos/textview.py
+++ b/examples/pygtk-demo/demos/textview.py
@@ -9,6 +9,8 @@ shows off the widget's text formatting features."""
 import os
 import sys
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/toolpalette.py b/examples/pygtk-demo/demos/toolpalette.py
index 82d30e4..fac779b 100644
--- a/examples/pygtk-demo/demos/toolpalette.py
+++ b/examples/pygtk-demo/demos/toolpalette.py
@@ -5,6 +5,8 @@ A tool palette widget shows groups of toolbar items as a grid of icons or a list
 """
 # pygtk version: John Stowers <john stowers gmail com>
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 class ToolPaletteDemo(gtk.Window):
diff --git a/examples/pygtk-demo/demos/tooltip.py b/examples/pygtk-demo/demos/tooltip.py
index eeabd3a..d19fbb3 100644
--- a/examples/pygtk-demo/demos/tooltip.py
+++ b/examples/pygtk-demo/demos/tooltip.py
@@ -5,6 +5,8 @@ This is a test of the new gtk tooltip system.  It is a
 fairly straight forward port of the example distributed with gtk.
 '''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import cairo
 import gobject
diff --git a/examples/pygtk-demo/demos/tree_store.py b/examples/pygtk-demo/demos/tree_store.py
index fc53644..1e438bb 100644
--- a/examples/pygtk-demo/demos/tree_store.py
+++ b/examples/pygtk-demo/demos/tree_store.py
@@ -7,6 +7,8 @@ GtkTreeStore and displays it. If you're new to the GtkTreeView widgets
 and associates, look into the GtkListStore example first.'''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/demos/treemodel.py b/examples/pygtk-demo/demos/treemodel.py
index 7fca9a0..3e31e96 100644
--- a/examples/pygtk-demo/demos/treemodel.py
+++ b/examples/pygtk-demo/demos/treemodel.py
@@ -4,6 +4,8 @@
 This test is designed to demonstrate creating a new type of tree model
 in python for use with the new tree widget in gtk 2.0.'''
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gobject
 
diff --git a/examples/pygtk-demo/demos/ui_manager.py b/examples/pygtk-demo/demos/ui_manager.py
index 02eed38..56510ac 100644
--- a/examples/pygtk-demo/demos/ui_manager.py
+++ b/examples/pygtk-demo/demos/ui_manager.py
@@ -6,6 +6,8 @@ from an array of actions and a description of the menu hierarchy.
 '''
 # pygtk version: Maik Hertha <maik hertha berlin de>
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/pygtk-demo/pygtk-demo.py b/examples/pygtk-demo/pygtk-demo.py
index 9fdb78b..54bd23b 100644
--- a/examples/pygtk-demo/pygtk-demo.py
+++ b/examples/pygtk-demo/pygtk-demo.py
@@ -10,11 +10,8 @@
 
 import string
 import re
-try:
-    import pygtk
-    pygtk.require('2.0')
-except ImportError:
-    pass
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 import pango
diff --git a/examples/simple/dnd.py b/examples/simple/dnd.py
index 0217def..e747221 100644
--- a/examples/simple/dnd.py
+++ b/examples/simple/dnd.py
@@ -1,5 +1,7 @@
 #! /usr/bin/env python
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 import gtk
 
diff --git a/examples/simple/hello.py b/examples/simple/hello.py
index 79909b0..97b9827 100755
--- a/examples/simple/hello.py
+++ b/examples/simple/hello.py
@@ -2,6 +2,8 @@
 
 """ Simple Hello World example similar to the GTK+ Tutorials one """
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 def hello(*args):
diff --git a/examples/simple/scribble.py b/examples/simple/scribble.py
index 465effd..bdb985e02 100755
--- a/examples/simple/scribble.py
+++ b/examples/simple/scribble.py
@@ -2,6 +2,8 @@
 
 #this is a simple translation of the scribble example that comes with GTK+
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 pixmap = None
diff --git a/examples/simple/simple.py b/examples/simple/simple.py
index 9785830..51b283a 100755
--- a/examples/simple/simple.py
+++ b/examples/simple/simple.py
@@ -4,6 +4,8 @@
 # new() function from gobject (this is an example of creating objects
 # with the properties interface).
 
+import pygtk
+pygtk.require('2.0')
 import gobject, gtk
 
 def hello(*args):
diff --git a/examples/simple/tooltip.py b/examples/simple/tooltip.py
index 0ef1d2b..2d1755b 100755
--- a/examples/simple/tooltip.py
+++ b/examples/simple/tooltip.py
@@ -3,6 +3,8 @@
 """ Simple example of creating a basic window and button.
     Also adds a tooltip. """
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 
 def hello_cb(widget, main_window):
diff --git a/examples/threading/gtk_threading.py b/examples/threading/gtk_threading.py
index 4ba4394..01416dd 100644
--- a/examples/threading/gtk_threading.py
+++ b/examples/threading/gtk_threading.py
@@ -4,6 +4,8 @@
 import time
 import threading
 
+import pygtk
+pygtk.require('2.0')
 import gtk
 import gobject
 
diff --git a/setup.py b/setup.py
index 3d352da..6f225bb 100755
--- a/setup.py
+++ b/setup.py
@@ -39,6 +39,9 @@ if sys.version_info[:3] < MIN_PYTHON_VERSION:
 
 # Check for pygobject (dsextras)
 try:
+    import pygtk
+    pygtk.require('2.0')
+
     from dsextras import GLOBAL_MACROS, GLOBAL_INC, get_m4_define, getoutput, \
                          have_pkgconfig, pkgc_version_check, pkgc_get_defs_dir, \
                          PkgConfigExtension, Template, TemplateExtension, \
diff --git a/tests/common-windows.py b/tests/common-windows.py
index d3babf0..11c1391 100644
--- a/tests/common-windows.py
+++ b/tests/common-windows.py
@@ -4,6 +4,8 @@
 import os
 import sys
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 
 sys.path.insert(0, os.path.dirname(__file__))
diff --git a/tests/common.py b/tests/common.py
index 33216e1..418a243 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -1,6 +1,8 @@
 import os
 import sys
 
+import pygtk
+pygtk.require('2.0')
 import gobject
 
 def importModules(buildDir, srcDir):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]