Skip to content

Commit

Permalink
Exit using Sugar toolbar Stop Button
Browse files Browse the repository at this point in the history
The activity process keep running even after closing the activity using the stop button on toolbar.
Confirmed using testing the activity from terminal using sugar-activity3
  • Loading branch information
JuiP committed Jul 11, 2020
1 parent 88f5fda commit 2a7e978
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Main.py
Expand Up @@ -237,11 +237,14 @@ def run(self):
pygame.display.update()

def handle_event(self):
for event in pygame.event.get(pygame.KEYDOWN):
tecla = event.key
if tecla == pygame.K_ESCAPE:
pygame.event.clear()
return self.selecciona_mensaje_salir()
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.estado = False
elif event.type == pygame.KEYDOWN:
tecla = event.key
if tecla == pygame.K_ESCAPE:
pygame.event.clear()
return self.selecciona_mensaje_salir()

def pause_game(self):
while self.mensaje.sprites():
Expand Down

0 comments on commit 2a7e978

Please sign in to comment.