Tk window and contents will not display
__peter__ at web.de
Sun Aug 15 01:46:20 CEST 2010
Chris Hare wrote:
> On Aug 14, 2010, at 5:49 PM, Peter Otten wrote:
>> Chris Hare wrote:
>>> Thanks Peter. I threw away what I started with and merged your code
>>> into my class:
>>> class externalLoopDisplay:
>>> def show(self):
>>> self.window = Tk()
>>> self.btnClose = Button(self.window, text="Close",
>>> highlightcolor=okColor) self.btnClose.grid(row=0, column=2)
>>> self.label = Label(self.window) self.label.grid(row=1, column=0,
>>> dirName = getRadarPath() + "/net" + str(netNumber.get()) # e.g.
> Thanks. One final question if I may, how would you suggest I handle
> checking for new files and adding them to the list? For example, if the
> loop is playing and a new image is added, how can I detect it and then
> refresh the list of file?
> I am stuck on that part with this new approach.
>>> self.imagefiles = glob.glob(dirName + "/*.gif")
>>> self.imagefiles = cycle(self.imagefiles)
self.imagefiles = image_cycler(os.path.join(dirname, "*.gif"))
where image_cycler() looks as follows
for fn in glob.glob(pattern):
would be the simplest way.
More information about the Python-list