Hello together,
I wrote the following class for producing "monitoring" output within an extra window.
- Unfortunately it doesn't scroll automatically down to the most recent line. What is wrong?
- As I also have problems with Tkinter and ipython: how would an equivalent implementation with qt4 look like?
Here is the code:
import Tkinter
class Monitor(object):
@classmethod
def write(cls, s):
try:
cls.text.insert(Tkinter.END, str(s) + "\n")
cls.text.update()
except Tkinter.TclError, e:
print str(s)
mw = Tkinter.Tk()
mw.title("Message Window by my Software")
text = Tkinter.Text(mw, width = 80, height = 10)
text.pack()
Usage:
Monitor.write("Hello World!")
Cheers, Philipp