classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view


Gloria Meneses

Hello people

I have a problem using canvas.
olpcgames canvas has 2 arguments: width and height. In my activity class I call canvas in this way:

self.canvas = olpcgames.canvas(1200, 750)

but I have this problem:

olpcgames.canvas: Uncaught top-level exception: Traceback (most recent call last):
  File "/home/monyu/Activities/StoryBuilder.activity/olpcgames/", line 116, in _start
TypeError: __init__() takes exactly 2 arguments (1 given)

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.5/", line 486, in __bootstrap_inner
  File "/usr/lib/python2.5/", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/monyu/Activities/StoryBuilder.activity/olpcgames/", line 124, in _start
RuntimeError: called outside of a mainloop

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.

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.

if ':' not in app:
 app += ':main'
 mod_name, fn_name = app.split(':')
 mod = __import__(mod_name, globals(), locals(), [])
 fn = getattr(mod, fn_name)

any hints
+ Software Libre en Colombia

+ OLPC Colombia

+ Mujeres en el software libre

Sugar mailing list
[hidden email]