I am working on migrating some code from using direct bindings to
using gi bindings. A good, simple example of the problem I am having
looks like this (Python):
import cluttergtk
import clutter
import gtk
class TestApp(object):
def __init__(self):
self.window = gtk.Window()
self.window.connect('destroy', gtk.main_quit)
self.window.set_title("Testing Clutter-GTK")
self.vbox = gtk.VBox()
self.window.add(self.vbox)
self.clutterembed = cluttergtk.Embed()
self.vbox.pack_start(self.clutterembed,True,True,0)
self.clutterembed.realize()
self.clutterstage = self.clutterembed.get_stage()
self.clutterstage.set_color(clutter.Color(red=0xff,
green=0xcc, blue=0xcc, alpha=0xff))
def Run(self):
self.window.show_all()
gtk.main()
if __name__ == '__main__':
App = TestApp()
App.Run()
When I run this using direct bindings, I get a blank, pink gtk window
with an embedded clutter stage, as planned. However, if I change it to
use gi, by changing the import statements to:
from gi.repository import GtkClutter as cluttergtk
from gi.repository import Clutter as clutter
from gi.repository import Gtk as gtk
self.clutterembed.get_stage() always returns None, so obviously I
can't set the color and the application crashes. So, the question is,
why does it return None? Is there a new way of setting up a
clutter-gtk stage that I am unaware of?
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list