Code: Alles auswählen
from Tkinter import *
quelle = "liste.txt"
text = "TEST..."
root = Tk()
scroll_y = Scrollbar(root, orient=VERTICAL)
scroll_y.grid(row=0, column=1, sticky="NS")
scroll_x = Scrollbar(root, orient=HORIZONTAL)
scroll_x.grid(row=1, column=0, sticky="WE")
textfeld = Text(root, yscrollcommand=scroll_y.set, xscrollcommand=scroll_x.set)
textfeld.grid(row=0, column=0)
scroll_y.config(command=textfeld.yview)
scroll_x.config(command=textfeld.xview)
lesen = open (quelle,"r")
for line in lesen.readlines():
text = text + line
textfeld.insert(END,text) ###---PROBLEM-ZEILE---###
root.mainloop()
Code: Alles auswählen
Segmentierungsfehler(coredump)
Das selbe Programm auf'm PC läuft wunderbar?!? Liegt das an der Pythonversion (2.2.2) od. dem Betriebssystem (UNIX) oder ein Fehler in Tkinter?
Oder gibt es noch eine andere Möglichkeit mehrzeiligen Text anzuzeigen und ein Scrollbalken zu haben?