42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
if ver==3:
from gi import pygtkcompat as pygtk
pygtk.enable()
pygtk.enable_gtk(version='3.0')
from gi.repository import Gtk as gtk
from gi.repository import GObject as gobject
from gi.repository import GdkPixbuf
empty_pixbuf = GdkPixbuf.Pixbuf.new_from_data(b"\0\0\0\0", GdkPixbuf.Colorspace.RGB, True, 8, 1, 1, 4, None, None)
__print__(dbg.STAT, gtk)
__print__(dbg.STAT, gobject)
else:
import pygtk
import gtk
import gobject
GdkPixbuf = gtk.gdk
empty_pixbuf = GdkPixbuf.Pixbuf(gtk.gdk.COLORSPACE_RGB,True,8,16,16)
empty_pixbuf.fill(0xFFFFFFFF)
# prepare gtkbuilder data
ui_xml = get_data("gtk3.xml.gz", decode=True, gz=True) #or get_data("gtk3.xml", decode=True)
if ver == 2:
ui_xml = ui_xml.replace('version="3.0"', 'version="2.16"')
|
>
|
>
|
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
if ver==3:
from gi import pygtkcompat as pygtk
pygtk.enable()
pygtk.enable_gtk(version='3.0')
from gi.repository import Gtk as gtk
from gi.repository import GObject as gobject
from gi.repository import GdkPixbuf
#empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 16, 16)#, 4, None, None)
empty_pixbuf = GdkPixbuf.Pixbuf.new_from_data(b"\xFF\xFF\xFF\xFF", GdkPixbuf.Colorspace.RGB, True, 8, 1, 1, 4, None, None)
__print__(dbg.STAT, gtk)
__print__(dbg.STAT, gobject)
else:
import pygtk
import gtk
import gobject
GdkPixbuf = gtk.gdk
empty_pixbuf = GdkPixbuf.Pixbuf(gtk.gdk.COLORSPACE_RGB,True,8,16,16)
#print empty_pixbuf.get_has_alpha()
#empty_pixbuf.fill(0xFFFFFFFF)
# prepare gtkbuilder data
ui_xml = get_data("gtk3.xml.gz", decode=True, gz=True) #or get_data("gtk3.xml", decode=True)
if ver == 2:
ui_xml = ui_xml.replace('version="3.0"', 'version="2.16"')
|