Since you are opening the file afresh each time in refreshLog, won't you be reading the first line each time? You probably want a persistent open stream from which you can keep reading. Also, have a look at gobject.io_add_watch, it is probably simpler than threading for your needs.
-Aravind ----- Original Message ---- From: Mark Stahler <[EMAIL PROTECTED]> To: PyGTK <pygtk@daa.com.au> Sent: Monday, December 3, 2007 4:42:56 AM Subject: [pygtk] A Timer and refreshing TextView Hello, I am attempting to have a textview tail the end of a log file. So far I can load the log and scroll to the end however I am running into a problem have the log file refresh. Code: textview = self.gui.get_widget("bottom_textview") # Methods that need to be run on start self.refreshLog() # Timer to autorefresh log timer = threading.Timer(10, self.refreshLog) timer.start() def refreshLog(self): file = open('log.txt') string = file.read() buffer = textview.get_buffer() buffer.set_text(string) mark = buffer.create_mark("end", buffer.get_end_iter()) textview.scroll_to_mark(mark, 0) buffer.delete_mark_by_name("end") The code seems to run ok but the text in the TextView does not update. I loaded the log into vi and appended some text and saved it but the program would not reload it. Am I overlooking something simple? Is there another way to do the timer? Thanks for the help! Mark _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/