给你fix点
This commit is contained in:
parent
f24a97e419
commit
8ff60ff133
18
main.py
18
main.py
@ -1,7 +1,6 @@
|
|||||||
import threading
|
import threading
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
# from arcade import load_sound, play_sound, stop_sound
|
|
||||||
from pyglet import media as pyglet_media
|
from pyglet import media as pyglet_media
|
||||||
|
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
@ -541,14 +540,25 @@ def countdown():
|
|||||||
|
|
||||||
def finishing():
|
def finishing():
|
||||||
global bigback_photo
|
global bigback_photo
|
||||||
|
sound = pyglet_media.load("support/sound.mp3")
|
||||||
|
player = sound.play()
|
||||||
for child in root.grid_slaves():
|
for child in root.grid_slaves():
|
||||||
child.grid_remove()
|
child.grid_remove()
|
||||||
tkinter.Label(text="时间到了", font=("华文行楷", 50)).grid(
|
tkinter.Label(text="时间到了", font=("华文行楷", 50)).grid(
|
||||||
column=0, columnspan=3, row=1, sticky="nsew"
|
column=0, columnspan=3, row=1, sticky="nsew"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def tmp():
|
||||||
|
player.pause()
|
||||||
|
welcome()
|
||||||
|
|
||||||
|
def tmp2():
|
||||||
|
player.pause()
|
||||||
|
schedule("fromclean")
|
||||||
|
|
||||||
cancel = tkinter.Button(
|
cancel = tkinter.Button(
|
||||||
text="确定",
|
text="确定",
|
||||||
command=lambda: stop_sound(player) | welcome(),
|
command=tmp,
|
||||||
font=("宋体", 30),
|
font=("宋体", 30),
|
||||||
bg="#4472c4",
|
bg="#4472c4",
|
||||||
activebackground="#4472c4",
|
activebackground="#4472c4",
|
||||||
@ -557,7 +567,7 @@ def countdown():
|
|||||||
cancel.grid(column=0, row=3, sticky="nsew")
|
cancel.grid(column=0, row=3, sticky="nsew")
|
||||||
back = tkinter.Button(
|
back = tkinter.Button(
|
||||||
image=bigback_photo,
|
image=bigback_photo,
|
||||||
command=lambda: stop_sound(player) | schedule("fromclean"),
|
command=tmp2,
|
||||||
font=("宋体", 30),
|
font=("宋体", 30),
|
||||||
height=60,
|
height=60,
|
||||||
bg="#4472c4",
|
bg="#4472c4",
|
||||||
@ -565,8 +575,6 @@ def countdown():
|
|||||||
fg="white",
|
fg="white",
|
||||||
)
|
)
|
||||||
back.grid(column=2, row=3, sticky="nsew")
|
back.grid(column=2, row=3, sticky="nsew")
|
||||||
sound = load_sound("support/sound.mp3")
|
|
||||||
player = play_sound(sound)
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
remain = hour * 60 * 60 + minute * 60 + second
|
remain = hour * 60 * 60 + minute * 60 + second
|
||||||
|
Loading…
Reference in New Issue
Block a user