I have started to use Geany 1.25 as IDE for pygame, so i am not quit sure whether this i a geany bug or i am doing something wrong. I tested the following and the problem is that by clicking on the close button nothing happens and the pygame window dosn't close (which actually should happen!). Can anyone help me with this? I am on an ubuntu 15.10 machine and have installed geany from its software center.
import pygame from pygame.locals import *
pygame.init()
RED=(100,0,0)
screen=pygame.display.set_mode([500,500])
screen.fill(RED)
runs=True
while runs: for e in pygame.event.get(): if e.type==QUIT: runs==False pygame.display.flip() pygame.quit()
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005
The `runs==False` looks wrong, but I think it should cause a compile error, not do something weird at runtime like C/C++ would.
You could try sticking `print("Quitting")` in the `if e.type == QUIT` block. If it prints "Quitting" when you press the close button, try replacing it with `sys.exit()` and see if it quits.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005#issuecomment-213811819
Hello and thanks for your help. I did what you said and it works! On other editores however i only having a pygame.quit() would suffice to close the window. Why is this not the case on the GREAT Geany? (I really just started to work in geany and loved it immidiately, i think i have now found lastly the editor i can enjoy!)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005#issuecomment-213814960
Okey , i see my typing problem now, it should be runs=False not runs==False.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005#issuecomment-213817558
Closed #1005.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005#event-638761074
I guess I over-estimated Python's compiler, indeed it gives no warnings for using an expression statement like that, and just discards the boolean result of the comparison (or in interactive interpreter, prints 'False').
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1005#issuecomment-213849462
github-comments@lists.geany.org