<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>&nbsp; File &quot;/home/monyu/Activities/StoryBuilder.activity/olpcgames/canvas.py&quot;, line 116, in _start<br>&nbsp;&nbsp;&nbsp; fn()<br>TypeError: __init__() takes exactly 2 arguments (1 given)<br>
<br>Exception in thread Thread-1:<br>Traceback (most recent call last):<br>&nbsp; File &quot;/usr/lib/python2.5/threading.py&quot;, line 486, in __bootstrap_inner<br>&nbsp;&nbsp;&nbsp; self.run()<br>&nbsp; File &quot;/usr/lib/python2.5/threading.py&quot;, line 446, in run<br>
&nbsp;&nbsp;&nbsp; self.__target(*self.__args, **self.__kwargs)<br>&nbsp; File &quot;/home/monyu/Activities/StoryBuilder.activity/olpcgames/canvas.py&quot;, line 124, in _start<br>&nbsp;&nbsp;&nbsp; gtk.main_quit()<br>RuntimeError: called outside of a mainloop<br>
<br><br>I reviewed several olpcgames activities but I don&#39;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&#39;t know how to set it on.<br>
<br>if &#39;:&#39; not in app:<br>&nbsp;app += &#39;:main&#39;<br>&nbsp;mod_name, fn_name = app.split(&#39;:&#39;)<br>&nbsp;mod = __import__(mod_name, globals(), locals(), [])<br>&nbsp;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>