summaryrefslogtreecommitdiff
path: root/pygtkcompat
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-06-21 07:27:48 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-06-21 07:27:48 +0200
commit61b268e44af63d6d78feae42578bf75aa5cfd511 (patch)
tree9bb6afcfb7f6bb3744b6f105a727fd26bd0146fb /pygtkcompat
parent5e3ab0bb974cc785659666b871d795730b4f06b3 (diff)
downloadpygobject-61b268e44af63d6d78feae42578bf75aa5cfd511.tar.gz
pygtkcompat: Fix for missing methods on Windows
Deal with non-existing Gtk.Clipboard.get() and GdkPixbuf.Pixbuf.new_from_file_at_scale() methods. https://bugzilla.gnome.org/show_bug.cgi?id=702787
Diffstat (limited to 'pygtkcompat')
-rw-r--r--pygtkcompat/pygtkcompat.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pygtkcompat/pygtkcompat.py b/pygtkcompat/pygtkcompat.py
index 4267a609..67571acd 100644
--- a/pygtkcompat/pygtkcompat.py
+++ b/pygtkcompat/pygtkcompat.py
@@ -139,7 +139,10 @@ def enable_gtk(version='3.0'):
Gdk.PixbufLoader = GdkPixbuf.PixbufLoader.new_with_type
Gdk.pixbuf_new_from_data = GdkPixbuf.Pixbuf.new_from_data
Gdk.pixbuf_new_from_file = GdkPixbuf.Pixbuf.new_from_file
- Gdk.pixbuf_new_from_file_at_scale = GdkPixbuf.Pixbuf.new_from_file_at_scale
+ try:
+ Gdk.pixbuf_new_from_file_at_scale = GdkPixbuf.Pixbuf.new_from_file_at_scale
+ except AttributeError:
+ pass
Gdk.pixbuf_new_from_file_at_size = GdkPixbuf.Pixbuf.new_from_file_at_size
Gdk.pixbuf_new_from_inline = GdkPixbuf.Pixbuf.new_from_inline
Gdk.pixbuf_new_from_stream = GdkPixbuf.Pixbuf.new_from_stream
@@ -349,7 +352,10 @@ def enable_gtk(version='3.0'):
Gtk.image_new_from_file = Gtk.Image.new_from_file
Gtk.settings_get_default = Gtk.Settings.get_default
Gtk.window_set_default_icon = Gtk.Window.set_default_icon
- Gtk.clipboard_get = Gtk.Clipboard.get
+ try:
+ Gtk.clipboard_get = Gtk.Clipboard.get
+ except AttributeError:
+ pass
#AccelGroup
Gtk.AccelGroup.connect_group = Gtk.AccelGroup.connect