Hi all,
I cannot get the draw signal to work in with Python 3. The following code is a bare bones examples of what I mean:
Code:
#!/usr/biqn/env python3.2
from gi.repository import Gtk, Gdk
class MyExample(object):
def __init__(self, user_data=None):
window = Gtk.Window()
window.connect("destroy", Gtk.main_quit)
drawing_area = Gtk.DrawingArea()
drawing_area.set_size_request(300,300)
drawing_area.connect('draw',self.expose)
window.add(drawing_area)
window.show_all()
def expose(self,widget,cr):
print ("self_exposed")
# ===
if __name__ == "__main__":
app = MyExample()
Gtk.main()
It runs fine with 2.7, but on 3.2 the screen appears but the
expose function never seems to run and when I quit the program I get the following message:
Quote:
Exception TypeError: TypeError("Couldn't find conversion for foreign struct 'cairo.Context'",) in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
I am using Linux Ubuntu 12.04. This problem has been encountered on other forums with no solution proposed.
Thanks for any ideas.
Mike