Re: [Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-21 Thread O'Gorman, Lawrence (Larry)
Thanks very much to all those who responded to me and thanks to my good buddy and Python wiz, Kirke. I've included my code below, which periodically checks if a file is changed, and if so, it changes the image displayed in a window. The trick (as suggested) was to use "after" to get the event to re

Re: [Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-20 Thread Igor Novikov
Yes, you are right. Solution without Tkinter usage is also possible. File watcher can be created on pure Python implementation: http://www.amk.ca/python/simple/dirwatch.html Sorry I forgot this issue because this thread is a [Tkinter-discuss] :) Regards, Igor Novikov sK1 Project http://sk1proje

Re: [Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-20 Thread Cameron Laird
On Wed, May 20, 2009 at 12:25:08PM +0300, Igor Novikov wrote: . . . > File system events are not a part of tk library so Tkinter doesn't process > such events. > Nevertheless native _tkinter library contains two file event rela

Re: [Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-20 Thread Cam Farnell
The only way I know of to do this is to use "after" to invoke a function which does the file checking and whatever else is required. That function sets another "after" - with perhaps a one second delay or whatever seems appropriate - to invoke itself. Thus the function is invoked repeatedly to

Re: [Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-20 Thread Igor Novikov
Hi Lawrence, File system events are not a part of tk library so Tkinter doesn't process such events. Nevertheless native _tkinter library contains two file event related procedures - createfilehandler() and deletefilehandler() So you can try finding samples how to use these functions. For example:

[Tkinter-discuss] non-GUI event detection in Tkinter mainloop()

2009-05-19 Thread O'Gorman, Lawrence (Larry)
I'm trying to figure out if Python and Tkinter can offer a solution to my following problem. I want to monitor a file and when that file is changed, I want to detect that event and have my window change its text from "File Unchanged" to "File has Changed." That is, I can produce a function to