How can i insert a scrollbar in my Tk window?
<p>I wrote this for my school project, but I can't figure out how to add a scroll bar.</p>

<pre><code>from Tkinter import* #import Tk

main_s= Tk()         #forming a Tk window
fundo = PhotoImage(file="d.gif")
class Welcome:    
     def __init__(self):
         def proceed():
               main_s.update()                        #config of the Tk window
               main_s.config(bg="yellow")
               Label(main_s,text="Choose your curve",fg="red",font=("arial",20)).pack()
               var=IntVar()  #variable for values of radios
               r1=Radiobutton(main_s,text="Circle",variable=var,value=1,command=curves)       '''creating radiobuttons which come below the canvas for which the scroll bar is needed'''
               r2=Radiobutton(main_s,text="Parabola",variable=var,value=2,command=curves)
               r3=Radiobutton(main_s,text="Ellipse",variable=var,value=3,command=curves)
               r4=Radiobutton(main_s,text="Line",variable=var,value=4,command=curves)
               r5=Radiobutton(main_s,text="Hyperbola",variable=var,value=5,command=curves)
               r1.pack()
               r2.pack()
               r3.pack()
               r4.pack()     #packing of radiom buttons
               r5.pack()   

# execution starts here, working with a Canvas object.
# the indentation level is same for __init__ of class

          self.scr = Canvas(main_s, width=1000, height=600)     #creating a canvas
          self.scr.pack()
          self.scr.create_image(0, 0, image=fundo, anchor='nw')   #placing image inside the canvas 
          main_s.config(bg="orange")
          main_s.title("*********")
          btn=Button(main_s,text="*********",fg="orange",command=proceed)
          btn.pack()
          def curves():
              class Curves:
                    def __init__(self):
                         main_s.update()                #adding more content to follow
                         i=Label(main_s,text="**********")
                         i.pack()
                         self.rotation=Entry(main_s)
                         self.rotation.pack()
                         i1=Label(main_s,text="*************")
                         i1.pack()
                         self.xshift=Entry(main_s)       #action of radio buttons 
                         self.xshift.pack()
                         i2=Label(main_s,text="**************")
                         i2.pack()
                         self.yshift=Entry(main_s)
                         self.yshift.pack()
                    t=Curves()
                         # execution of radio buttons command


#execution -calling the above instances
Welcome()
main_s.mainloop()
</code></pre>

<p>Here is your standard vetical scrollbar. Nice project by the way, at our school the most complicated thing we do is text based programs XD</p>

<p>I see you're new to stack overflow, what you wanna do is press that nice big green tick next to my answer :)</p>

<pre><code>from Tkinter import* #import Tk

main_s= Tk()         #forming a Tk window
fundo = PhotoImage(file="d.gif")
class Welcome:    
    def __init__(self):
        def proceed():
            main_s.update()                        #config of the Tk window
            main_s.config(bg="yellow")
            Label(main_s,text="Choose your curve",fg="red",font=("arial",20)).pack()
            var=IntVar()  #variable for values of radios
            r1=Radiobutton(main_s,text="Circle",variable=var,value=1,command=curves)       #'''creating radiobuttons which come below the canvas for which the scroll bar is needed'''
            r2=Radiobutton(main_s,text="Parabola",variable=var,value=2,command=curves)
            r3=Radiobutton(main_s,text="Ellipse",variable=var,value=3,command=curves)
            r4=Radiobutton(main_s,text="Line",variable=var,value=4,command=curves)
            r5=Radiobutton(main_s,text="Hyperbola",variable=var,value=5,command=curves)
            r1.pack()
            r2.pack()
            r3.pack()
            r4.pack()     #packing of radiom buttons
            r5.pack()   

# execution starts here, working with a Canvas object.
# the indentation level is same for __init__ of class

        self.frame = Frame(main_s)
        self.scr = Canvas(self.frame, width=1000, height=200, scrollregion = (0, 0, 0, 500))     #creating a canvas
        self.bar = Scrollbar(self.frame, orient = "vertical")
        self.scr.grid(row = 0, column = 1)
        self.bar.grid(row = 0, column = 0, sticky = "ns")
        self.scr.config(yscrollcommand = self.bar.set)
        self.bar.config(command = self.scr.yview)
        self.frame.pack()


        self.scr.create_image(0, 0, image=fundo, anchor='nw')   #placing image inside the canvas        
        main_s.config(bg="orange")
        main_s.title("*********")
        btn=Button(main_s,text="*********",fg="orange",command=proceed)
        btn.pack()
        def curves():
            class Curves:
                def __init__(self):
                    main_s.update()                #adding more content to follow
                    i=Label(main_s,text="**********")
                    i.pack()
                    self.rotation=Entry(main_s)
                    self.rotation.pack()
                    i1=Label(main_s,text="*************")
                    i1.pack()
                    self.xshift=Entry(main_s)       #action of radio buttons 
                    self.xshift.pack()
                    i2=Label(main_s,text="**************")
                    i2.pack()
                    self.yshift=Entry(main_s)
                    self.yshift.pack()
            t=Curves()
            # execution of radio buttons command


#execution -calling the above instances
Welcome()
main_s.mainloop()
</code></pre>

python tkinter tk