[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] [RFC] Decorator-based event trapping.
- To: pygame-users@xxxxxxxx
- Subject: [pygame] [RFC] Decorator-based event trapping.
- From: Martin Kühne <mysatyre@xxxxxxxxx>
- Date: Wed, 17 Aug 2016 12:23:44 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 17 Aug 2016 06:24:08 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=QkmXgozgy0az+fNfzuiR6VpXkzW0pUwuMxNN+ftYFz4=; b=orlogPw0qjaSKJcF4LrH6NHyCKsI0sR8wkBUu73yBT2F9bKide+9qDFk57y78eggbH sZ9ktlC3Q5coMd7p0XJUjXTnJwRy/e8TXXoAucwG4MeCqn1D2ikgSrQSc0Ik0/eIYjMH qmX+c735k3fIaifW40IbPrtCFm/Ci8CbLE8fcvR1YjCK6P0jOd2RPmC+9y/hX2K4/fX0 wr/3OCoQGBucA9LnOkGmtTq9e0zc270owxQFTuJoeprZ8lR3DcY3W1mn5LAG/jC80RFv wRov7K6Bm8HhxW47ziNA32vpGP+OVSKLgePQE+ii9d2PMKSq+F1hLdp40EpcC6iwlSOX kcLg==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello list,
On [0] I saw that pygame is looking for an event binding approach
similar to that of turtle. Looking up what turtle does, I noticed I
went even a step further using decorators (code in [1], usage in [2]
lines 177, 324ff). Maybe the final solution ideally composes both
these approaches?
cheers!
mar77i
[0] http://www.pygame.org/wiki/todo#Event%20Binding
[1] https://github.com/mar77i/mandelizer/blob/master/input.py
[2] https://github.com/mar77i/mandelizer/blob/master/mandelizer.py