Hi,

You may try to add the sleep(5) after the color change statement. You could 
adjust the sleep time to let the color change and beep synchroize.

Thanks.



Yimr Zero
 
From: ast
Date: 2014-11-13 18:50
To: python-list
Subject: Synchronizing a sound with a widget change
Hello, here is a small test code:
 
----------------
from tkinter import Tk, Frame
from winsound import Beep
 
root = Tk()
 
f = Frame(root, width=300, height=300)
f.pack()
 
f.config(bg='Yellow')
Beep(2000, 1000)
--------------
 
I intended to change the frame color to yellow (f.config(bg='Yellow'))
and at the same time to emit a sound (Beep(2000, 1000))
 
But I first have the sound and when the sound is over the window appears.
 
Is there a way to fix that ?
 
I have the idea to run an other thread to emit the sound, but I didn't try yet.
Is it the solution ?
 
Thanks
 
 
 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to