Skip to content
Browse files

Fixed event handling

  • Loading branch information...
1 parent 2599726 commit 45a02db2a178f4b24cec1636fe0941df167f52ac @Hugoagogo committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 main.py
View
10 main.py
@@ -271,24 +271,26 @@ def __init__(self,*args, **kwargs):
def push_state(self,state):
state.parent = self
if len(self.states):
- self.pop_handlers()
self.states[-1].deactivate()
self.states.append(state)
self.states[-1].activate()
- self.push_handlers(self.states[-1])
def pop_state(self,state=None):
- self.pop_handlers()
self.states[-1].deactivate()
self.states.pop(-1)
if state != None:
state.parent = self
self.states.append(state)
if len(self.states):
- self.push_handlers(self.states[-1])
self.states[-1].activate()
else:
quit()
+ def __getattr__(self,attr):
+ if hasattr(self.states[-1],attr):
+ print "here"
+ return getattr(self.states[-1],attr)
+ raise AttributeError
+
def on_draw(self):
self.viewport.begin()
self.states[-1].on_draw()

0 comments on commit 45a02db

Please sign in to comment.
Something went wrong with that request. Please try again.