Fix windows icon and exit
This commit is contained in:
9
main.py
9
main.py
@@ -1,6 +1,7 @@
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import color
|
import color
|
||||||
|
import sys
|
||||||
from game import fall, osu, pong, space
|
from game import fall, osu, pong, space
|
||||||
from PIL import Image, ImageTk
|
from PIL import Image, ImageTk
|
||||||
from time import sleep
|
from time import sleep
|
||||||
@@ -75,7 +76,12 @@ def main():
|
|||||||
canvas_space.place(x = 404, y = 304)
|
canvas_space.place(x = 404, y = 304)
|
||||||
|
|
||||||
# Logo
|
# Logo
|
||||||
win.iconbitmap('res/logo/main.ico')
|
if sys.platform.startswith('win'):
|
||||||
|
win.iconbitmap('res/logo/icon.ico')
|
||||||
|
else:
|
||||||
|
logo = tk.PhotoImage('res/logo/icon.png')
|
||||||
|
win.tk.call('wm', 'iconphoto', win._w, logo)
|
||||||
|
|
||||||
tk.Label(win, image = image_center, bg = color.LEVEL_1).place(x = 401 - 32, y = 301 - 32)
|
tk.Label(win, image = image_center, bg = color.LEVEL_1).place(x = 401 - 32, y = 301 - 32)
|
||||||
|
|
||||||
# Score
|
# Score
|
||||||
@@ -116,6 +122,7 @@ def end():
|
|||||||
|
|
||||||
# Terminate
|
# Terminate
|
||||||
win.destroy()
|
win.destroy()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
# Main
|
# Main
|
||||||
print('Bienvenue dans le jeu QuadraLudi')
|
print('Bienvenue dans le jeu QuadraLudi')
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
BIN
res/logo/icon.png
Normal file
BIN
res/logo/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
Reference in New Issue
Block a user