Эх сурвалжийг харах

fix: set_icon try/exceept

micha 8 сар өмнө
parent
commit
6f485abe1e
5 өөрчлөгдсөн 32 нэмэгдсэн , 11 устгасан
  1. 6 2
      tksdl/demo.py
  2. 6 3
      tksdl/dmx.py
  3. 6 2
      tksdl/fix.py
  4. 7 2
      tksdl/midi.py
  5. 7 2
      tksdl/start.py

+ 6 - 2
tksdl/demo.py

@@ -25,8 +25,12 @@ pg = pygame
 pygame.init()
 pygame.mixer.quit()
 clock = pygame.time.Clock()
-icon = pygame.image.load('icon/scribble.png')
-pygame.display.set_icon(icon)
+try:
+    icon = pygame.image.load('icon/scribble.png')
+    pygame.display.set_icon(icon)
+except Exception as e:
+    print("      ERROR:",os.getcwd())
+    print("      ERROR:set_icon ",e) #,color="red")
 
 import tool.movewin as movewin
 import tool.sdl_elm as sdl_elm

+ 6 - 3
tksdl/dmx.py

@@ -46,9 +46,12 @@ pg = pygame
 pygame.init()
 pygame.mixer.quit()
 clock = pygame.time.Clock()
-icon = pygame.image.load('icon/scribble.png')
-pygame.display.set_icon(icon)
-
+try:
+    icon = pygame.image.load('icon/scribble.png')
+    pygame.display.set_icon(icon)
+except Exception as e:
+    print("      ERROR:",os.getcwd())
+    print("      ERROR:set_icon ",e) #,color="red")
 import tool.sdl_elm as sdl_elm
 
 

+ 6 - 2
tksdl/fix.py

@@ -62,8 +62,12 @@ pg = pygame
 pygame.init()
 pygame.mixer.quit()
 clock = pygame.time.Clock()
-icon = pygame.image.load('icon/scribble.png')
-pygame.display.set_icon(icon)
+try:
+    icon = pygame.image.load('icon/scribble.png')
+    pygame.display.set_icon(icon)
+except Exception as e:
+    print("      ERROR:",os.getcwd())
+    print("      ERROR:set_icon ",e) #,color="red")
 
 import tool.movewin as movewin
 import tool.sdl_elm as sdl_elm

+ 7 - 2
tksdl/midi.py

@@ -58,8 +58,13 @@ window = pygame.display.set_mode(main_size)#,pg.RESIZABLE,32)
 pg = pygame
 pygame.init()
 pg.display.set_caption(CAPTION)
-icon = pygame.image.load('icon/scribble.png')
-pygame.display.set_icon(icon)
+try:
+    icon = pygame.image.load('icon/scribble.png')
+    pygame.display.set_icon(icon)
+except Exception as e:
+    print("      ERROR:",os.getcwd())
+    print("      ERROR:set_icon ",e) #,color="red")
+import tool.sdl_elm as sdl_elm
 
 pygame.mixer.quit()
 clock = pygame.time.Clock()

+ 7 - 2
tksdl/start.py

@@ -45,8 +45,13 @@ pg = pygame
 pygame.init()
 pygame.mixer.quit()
 clock = pygame.time.Clock()
-icon = pygame.image.load('icon/scribble.png')
-pygame.display.set_icon(icon)
+
+try:
+    icon = pygame.image.load('icon/scribble.png')
+    pygame.display.set_icon(icon)
+except Exception as e:
+    print("      ERROR:",os.getcwd())
+    print("      ERROR:set_icon ",e) #,color="red")
 
 import tool.movewin as movewin
 import tool.sdl_elm as sdl_elm