<br>Hello people<br><br>I have a problem using canvas. <br>olpcgames canvas has 2 arguments: width and height. In my activity class I call canvas in this way:<br><br>self.canvas = olpcgames.canvas(1200, 750)<br><br>but I have this problem:<br>
<br>olpcgames.canvas: Uncaught top-level exception: Traceback (most recent call last):<br> File "/home/monyu/Activities/StoryBuilder.activity/olpcgames/canvas.py", line 116, in _start<br> fn()<br>TypeError: __init__() takes exactly 2 arguments (1 given)<br>
<br>Exception in thread Thread-1:<br>Traceback (most recent call last):<br> File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br> self.run()<br> File "/usr/lib/python2.5/threading.py", line 446, in run<br>
self.__target(*self.__args, **self.__kwargs)<br> File "/home/monyu/Activities/StoryBuilder.activity/olpcgames/canvas.py", line 124, in _start<br> gtk.main_quit()<br>RuntimeError: called outside of a mainloop<br>
<br><br>I reviewed several olpcgames activities but I don't understand how to show the content of my game into the canvas, so I was following the Activity tutorial but I got the same log.<br clear="all"><br>reviewed the olpcgames canvas source code and the method connect_game is looking for the name of activity main loop, but I don't know how to set it on.<br>
<br>if ':' not in app:<br> app += ':main'<br> mod_name, fn_name = app.split(':')<br> mod = __import__(mod_name, globals(), locals(), [])<br> fn = getattr(mod, fn_name)<br><br>any hints<br>Thanks<br>
-- <br>--------------------------------------------<br>+ Software Libre en Colombia<br><a href="http://el-directorio.org">http://el-directorio.org</a> <br><br>+ OLPC Colombia<br><a href="http://wiki.laptop.org/go/OLPC_Colombia">http://wiki.laptop.org/go/OLPC_Colombia</a><br>
<br>+ Mujeres en el software libre<br><a href="http://www.chicaslinux.org">http://www.chicaslinux.org</a><br>