Hi Vincent,
Suppose your code to read the text file and display the content is encapsulated in a function called read_and_display().
1) If you want to refresh it at a fixed interval, e.g. every hour, then use:
Gtk::timeout_add(1000 * 60 * 60, 'read_and_display');
2) If you want to update the content close to "real-time", then use
Gtk::idle_add('check_for_update');
In the function check_for_update(), you can do a check of filesize, etc. If there's any changes, then call the read_and_display() to update the contents.
I've quite a number of sample codes on timeout_add() and idle_add(). Use the
Search module to see the entire list.
Regards,
/kksou