Mask some incompatibilities with older gtk

This commit is contained in:
Chris Jones 2010-01-21 13:23:39 +00:00
parent 103428d0e3
commit 81e00fca0b
2 changed files with 7 additions and 1 deletions

View File

@ -410,7 +410,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
screen_w = gtk.gdk.screen_width()
screen_h = gtk.gdk.screen_height()
if gtk.gtk_version >= (2, 14):
widget_win = widget.get_window()
else:
widget_win = widget.window
widget_x, widget_y = widget_win.get_origin()
widget_w, widget_h = widget_win.get_size()

View File

@ -130,6 +130,9 @@ def shell_lookup():
def widget_pixbuf(widget, maxsize=None):
"""Generate a pixbuf of a widget"""
if gtk.gtk_version > (2, 14):
return(None)
pixmap = widget.get_snapshot()
(width, height) = pixmap.get_size()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)