On Thu, Mar 5, 2009 at 3:16 PM, Lynx <[email protected]> wrote: > > On Mar 5, 7:31 am, Jon Atkinson <[email protected]> wrote: > > class Engine(object): > > def __init__(self): > > # Open a window. > > self.window = pyglet.window.Window() > > self.window.clear() > > ... > > @self.window.event > > def on_draw(): > > print "MONKEY!" > > self isn't defined at that particular location. You should put this > code into __init__ instead.
Also note that your definition of on_draw() is not a member function, as it doesn't take the self argument. -- Tristam MacDonald http://swiftcoder.wordpress.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
