Das Beispiel dafür währe:
Code: Alles auswählen
from Tkinter import *
class MainWindow:
def __init__ (self):
self.fenster = Tk()
self.fenster.columnconfigure(0, weight=1)
self.fenster.rowconfigure(0, weight=1)
self.text = Text(self.fenster, width=40, height=40)
self.text.grid(row=0, column=0, sticky="nesw")
self.verticalScroller = Scrollbar(self.fenster, orient="vertical")
self.verticalScroller.grid(row=0, column=1, sticky="ns")
self.text['yscrollcommand'] = self.verticalScroller.set
self.verticalScroller['command'] = self.text.yview
self.bt_sys = Button(self.fenster, text="Zahlen", command=self.zahlen).grid()
self.fenster.mainloop()
def zahlen(self):
for j in range(1,300):
self.text.insert(INSERT , str(j) + '\n')
print j
mw = MainWindow()
Könnte mir jemand helfen?
Danke im Voraus!