diff options
author | Martin Pitt <martinpitt@gnome.org> | 2013-06-21 07:27:48 +0200 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-06-21 07:27:48 +0200 |
commit | 61b268e44af63d6d78feae42578bf75aa5cfd511 (patch) | |
tree | 9bb6afcfb7f6bb3744b6f105a727fd26bd0146fb /pygtkcompat | |
parent | 5e3ab0bb974cc785659666b871d795730b4f06b3 (diff) | |
download | pygobject-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.py | 10 |
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 |