GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Sep 20, 2014 3:56 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Python 3.2 and GTK3
PostPosted: Thu Jul 05, 2012 1:15 pm 
Offline

Joined: Thu Jul 05, 2012 12:54 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group