0

I currency have this, but I would like to add a scrollbar. All the methods I've seen have either Listbox or canvas which I'm not using.

import Tkinter as tk

file = open('curfile')
data = file.read()
file.close()
window = tk.Tk()

Results = tk.Label(window, text=data, justify='left')
Results.grid(row = 1, column = 1)
Results.configure(background='black', foreground='white')

window.mainloop()
bmikolaj
  • 485
  • 1
  • 5
  • 16
  • The Problem is that Frame, Tk and Toplevel do not support scrollbars. That is why you need a Listbox or a Canvas. Possible Duplicate: [Python Tkinter scrollbar for frame](http://stackoverflow.com/questions/16188420/python-tkinter-scrollbar-for-frame) – User Nov 07 '14 at 05:57
  • How would I go about doing what my code currently does via `Listbox` or `Canvas`? – bmikolaj Nov 07 '14 at 14:43
  • Use [this example](http://stackoverflow.com/a/16198198/1320237) and change it. – User Nov 07 '14 at 14:58
  • 1
    Text widgets also take scrollbars. – Terry Jan Reedy Nov 08 '14 at 01:16

0 Answers0