def drawNext(self):
     SlideShow.drawNext(self)
     if self.image: 
         self.name.config(text=os.path.split(self.image[0])[1])
     self.destroyer.acquire()
     self.switchNote()                         # don't let editor go away
     self.destroyer.release()
コード例 #2
0
 def drawNext(self):
     SlideShow.drawNext(self)
     if self.image:
         self.name.config(text=os.path.split(self.image[0])[1])
     self.destroyer.acquire()
     self.switchNote()  # don't let editor go away
     self.destroyer.release()
 def makeWidgets(self):
     self.name = Label(self, text='None', bg='red', relief=RIDGE)
     self.name.pack(fill=X)
     SlideShow.makeWidgets(self)
     Button(self, text='Note', command=self.onNote).pack(fill=BOTH)
     s = Scale(label='Speed: msec delay', command=self.onScale, 
               from_=0, to=3000, resolution=50, showvalue=YES,
               length=400, tickinterval=250, orient='horizontal')
     s.pack(side=BOTTOM, fill=X, expand=YES)
     s.set(self.msecs)
     self.editor = self.image = None
コード例 #4
0
 def makeWidgets(self):
     self.name = Label(self, text='None', bg='red', relief=RIDGE)
     self.name.pack(fill=X)
     SlideShow.makeWidgets(self)
     Button(self, text='Note', command=self.onNote).pack(fill=BOTH)
     s = Scale(label='Speed: msec delay',
               command=self.onScale,
               from_=0,
               to=3000,
               resolution=50,
               showvalue=YES,
               length=400,
               tickinterval=250,
               orient='horizontal')
     s.pack(side=BOTTOM, fill=X, expand=YES)
     s.set(self.msecs)
     self.editor = self.image = None
コード例 #5
0
 def onQuit(self):
     self.saveNote()
     SlideShow.onQuit(self)
コード例 #6
0
 def onOpen(self):
     SlideShow.onOpen(self)
     if self.image:
         self.name.config(text=os.path.split(self.image[0])[1])
     self.config(cursor='crosshair')
     self.switchNote()
コード例 #7
0
 def onStop(self):
     SlideShow.onStop(self)
     self.config(cursor='hand2')
コード例 #8
0
 def onStart(self):
     SlideShow.onStart(self)
     self.config(cursor='watch')
コード例 #9
0
 def __init__(self, parent, picdir, editclass, msecs=2000):
     self.msecs = msecs
     self.editclass = editclass
     self.destroyer = thread.allocate_lock()
     SlideShow.__init__(self, parent=parent, picdir=picdir, msecs=msecs)
コード例 #10
0
# runs two slideshows as thread, changes 5 times/second
# you might be able to go a bit faster on your machine

import sys
from Tkinter import *
from slideShow_threads import SlideShow

if len(sys.argv) == 2:
    picdir = sys.argv[1]
else:
    picdir = '../gifs'

root = Tk()
Label(root, text="Two embedded slide shows: each side is a thread").pack()
SlideShow(root, msecs=200, picdir=picdir, bd=3, relief=SUNKEN).pack(side=LEFT)
SlideShow(root, msecs=200, picdir=picdir, bd=3, relief=SUNKEN).pack(side=LEFT)
root.mainloop()
 def onQuit(self):
     self.saveNote()
     SlideShow.onQuit(self)
 def onOpen(self):
     SlideShow.onOpen(self)
     if self.image: 
         self.name.config(text=os.path.split(self.image[0])[1])
     self.config(cursor='crosshair')
     self.switchNote()
 def onStop(self):
     SlideShow.onStop(self)
     self.config(cursor='hand2')
 def onStart(self):
     SlideShow.onStart(self)
     self.config(cursor='watch')
 def __init__(self, parent, picdir, editclass, msecs=2000):
     self.msecs = msecs
     self.editclass = editclass
     self.destroyer = thread.allocate_lock()
     SlideShow.__init__(self, parent=parent, picdir=picdir, msecs=msecs)