gdk thread locking for album art

use gdk.threads_enter() and gdk.threads_leave() to lock the album art
changing section of the AlbumArt class.
This commit is contained in:
Bryan Schumaker 2010-11-02 17:06:49 -04:00
parent cc8ea2d11f
commit cbaa8753bd
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# Bryan Schumaker (10/24/2010)
import libsaria
import gtk
gdk = gtk.gdk
from libsaria import threads
@ -38,13 +39,13 @@ class AlbumArt(Image):
self.file = "images/ocarina.png"
def set(self, file=None):
lock.acquire()
gdk.threads_enter()
if file != None:
self.file = file
self.set_from_file(self.file)
self.set_height(64)
self.show()
lock.release()
gdk.threads_leave()
def set_height(self, new_h):
size = self.size_request()