title: The horizontal scrollbar didn't work in Tkinter
body: <p>I want to create a GUI program base on tkinter. One of the widgets is <code>Text</code>. I want to add a horizontal scrollbar in it, but it didn't work. </p>
  
  <p>Where did I make a mistake?</p>
  
  <pre><code>from Tkinter import *
  import tkFont
  
  
  class DpWin(object):
  
      def run(self):
          root=Tk()
          root.geometry('768x612')
          title='dp'
          root.title(title)
  
          xscrollbar = Scrollbar(root, orient=HORIZONTAL)
          xscrollbar.pack(side=BOTTOM, fill=X)
  
          yscrollbar = Scrollbar(root)
          yscrollbar.pack(side=RIGHT, fill=Y)
  
          text = Text(root,xscrollcommand=xscrollbar.set,yscrollcommand=yscrollbar.set)
          text.pack()
  
          xscrollbar.config(command=text.xview)
          yscrollbar.config(command=text.yview)
          text.insert(END,'a'*999)
          mainloop()
  
      def start(self):
          self.b_start.config(state=DISABLED)
          self.b_stop.config(state=ACTIVE)
  
      def stop(self):
          self.b_stop.config(state=DISABLED)
          self.b_start.config(state=ACTIVE)
  
  
  if __name__=='__main__':
      win=DpWin()
      win.run()
  </code></pre>