import tkinter
from tkinter import ttk
top=tkinter.Tk()
top.title("Scoreboard")
top.configure(background="black")
w=ttk.Scrollbar(top,orient='vertical')
l1=tkinter.Label(top,height=2,width=67,bd=4,text="Welcome To Cricket World Cup 2015",font=("Purisa",15),fg="white",bg="red",relief="ridge")
l1.grid(row=0,column=0,columnspan=67)
l2=tkinter.Label(top,height=2,width=25,font=("Purisa",15),text="India",fg="white",bg="red",relief="ridge")
l2.grid(row=1,column=0)
l3=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="VS",fg="white",bg="black")
l3.grid(row=1,column=1)
l4=tkinter.Label(top,height=2,width=25,font=("Purisa",15),text="Australia",fg="white",bg="red",relief="ridge")
l4.grid(row=1,column=2)
l5=tkinter.Label(top,height=9,width=67,bd=4,font=("Purisa",15),bg="red",relief="ridge")
l5.grid(row=3,column=0,columnspan=67)
l6=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="India",fg="white",bg="Black",relief="ridge")
l6.grid(row=3,column=0,rowspan=1,sticky="NW")
l7=tkinter.Label(top,height=3,width=14,font=("Purisa",20),text="183/2",fg="white",bg="Black",relief="ridge")
l7.grid(row=3,column=0)
l8=tkinter.Label(top,height=3,width=14,font=("Purisa",20),text="45.1",fg="white",bg="Black",relief="ridge")
l8.grid(row=3,column=2)
l9=tkinter.Label(top,height=3,width=20,font=("Purisa",12),text="RR = 4.057 ",fg="white",bg="Black",relief="ridge")
l9.grid(row=3,column=1,rowspan=1)
l10=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="Toss = Australia",fg="white",bg="Black",relief="ridge")
l10.grid(row=3,column=2,rowspan=1,sticky="NE")
l11=tkinter.Label(top,height=7,width=67,bd=4,font=("Purisa",15),bg="red",relief="ridge")
l11.grid(row=6,column=0,columnspan=67)
l12=tkinter.Label(top,height=2,width=13,font=("Purisa",20),text="Player name",fg="white",bg="Black",relief="ridge")
l12.grid(row=6,column=0,sticky="NWE")
l13=tkinter.Label(top,height=2,width=12,font=("Purisa",20),text="Balls",fg="white",bg="Black",relief="ridge")
l13.grid(row=6,column=2,sticky="NEW")
l14=tkinter.Label(top,height=2,width=11,font=("Purisa",20),text="Runs",fg="white",bg="Black",relief="ridge")
l14.grid(row=6,column=1,sticky="NWE")
l15=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="44",fg="white",bg="Black",relief="ridge")
l15.grid(row=6,column=2,columnspan=8,sticky="e")
l16=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="MS Dhoni",fg="white",bg="Black",relief="ridge")
l16.grid(row=6,column=0,sticky="w")
l17=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="37",fg="white",bg="Black",relief="ridge")
l17.grid(row=6,column=1,rowspan=1)
l18=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="Rahane",fg="white",bg="Black",relief="ridge")
l18.grid(row=6,column=0,sticky="SW")
l19=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="12",fg="white",bg="Black",relief="ridge")
l19.grid(row=6,column=1,sticky="S")
l20=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="29",fg="white",bg="Black",relief="ridge")
l20.grid(row=6,column=2,sticky="ES")
l21=tkinter.Label(top,height=8,width=67,bd=4,font=("Purisa",15),bg="red",relief="ridge")
l21.grid(row=7,column=0,columnspan=67)
l22=tkinter.Label(top,height=2,width=10,font=("Purisa",20),text="Player name",fg="white",bg="Black",relief="ridge")
l22.grid(row=7,column=0,sticky="NWE")
l23=tkinter.Label(top,height=2,width=11,font=("Purisa",20),text="Bowler Name",fg="white",bg="Black",relief="ridge")
l23.grid(row=7,column=1,sticky="NEW")
l24=tkinter.Label(top,height=2,width=10,font=("Purisa",20),text="FOW",fg="white",bg="Black",relief="ridge")
l24.grid(row=7,column=2,sticky="NEW")
l25=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="Kholi",fg="white",bg="Black",relief="ridge")
l25.grid(row=7,column=0,sticky="w")
l26=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="Starc",fg="white",bg="Black",relief="ridge")
l26.grid(row=7,column=1,rowspan=1)
l27=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="44/1",fg="white",bg="Black",relief="ridge")
l27.grid(row=7,column=2,columnspan=8,sticky="e")
l28=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="Rohit",fg="white",bg="Black",relief="ridge")
l28.grid(row=7,column=0,sticky="SW")
l29=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="Johnson",fg="white",bg="Black",relief="ridge")
l29.grid(row=7,column=1,sticky="S")
l30=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="80/2",fg="white",bg="Black",relief="ridge")
l30.grid(row=7,column=2,sticky="ES")
top.geometry("746x746")
top.mainloop()

You have to apply the scrollbar to a particular widget, for example ...

''' ttk_Scrollbar101.py
explore the ttk scrollbar widget
'''

try:
    # Python27
    import Tkinter as tk
    import ttk
except ImportError:
    # Python3
    import tkinter as tk
    import tkinter.ttk as ttk

root = tk.Tk()
scrollbar = ttk.Scrollbar(root)
scrollbar.pack(side='right', fill='y')

listbox = tk.Listbox(root, yscrollcommand=scrollbar.set)
# load the listbox
for n in range(1, 26):
   listbox.insert('end', "This is line number " + str(n))

listbox.pack(side='left', fill='both')
scrollbar.config(command=listbox.yview)

root.mainloop()

FYI, tkinter extension tix has a scrolled window.

Edited 1 Year Ago by vegaseat

This question has already been answered. Start a new discussion instead.