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