Custom Events in pygame

Posted by SapphireSun on Stack Overflow See other posts from Stack Overflow or by SapphireSun
Published on 2010-02-17T02:23:20Z Indexed on 2010/04/01 9:03 UTC
Read the original article Hit count: 467

Filed under:
|

Hello everyone,

I'm having trouble getting my custom events to fire. My regular events work fine, but I guess I'm doing something wrong. Here is the relevant code:

    evt = pygame.event.Event(gui.INFOEVENT, {'time':time,'freq':freq,'db':db})
    print "POSTING", evt
    pygame.event.post(evt)

   .... Later ....

    for event in pygame.event.get():
        print "GOT", event
        if event.type == pygame.QUIT:
            sys.exit()
        dispatcher.dispatch(event) 

gui.INFOEVENT = 101 by the way. The POSTING print statement fires, but the GOT one never shows my event.

Thanks!

© Stack Overflow or respective owner

Related posts about pygame

Related posts about custom-event