Exit on window close

This commit is contained in:
simondlevy
2018-06-30 19:20:28 -04:00
parent 46d2d49392
commit 189a2dcc8d
2 changed files with 6 additions and 6 deletions

View File

@@ -59,8 +59,7 @@ if __name__ == '__main__':
display.setPose(x, y, theta)
# Exit on ESCape
key = display.refresh()
if key != None and (key&0x1A):
# Exit on window close
if not display.refresh():
exit(0)

View File

@@ -30,6 +30,8 @@ from xvlidar import XVLidar as Lidar
from pltslamshow import SlamShow
from sys import stdout
if __name__ == '__main__':
# Connect to Lidar unit
@@ -62,8 +64,7 @@ if __name__ == '__main__':
display.setPose(x, y, theta)
# Exit on ESCape
key = display.refresh()
if key != None and (key&0x1A):
# Exit on window close
if not display.refresh():
exit(0)