text: ## ripped from standard library
  ## changed order of imports to use ttk scrollbar
  ## for L&F reasons!
  
  
  __all__ = ['ScrolledText']
  
  from tkinter import*
  from tkinter.ttk import *
  from tkinter.constants import RIGHT, LEFT, Y, BOTH
  
  class ScrolledText(Text):
      def __init__(self, master=None, **kw):
          self.frame = Frame(master)
          self.vbar = Scrollbar(self.frame)
          self.vbar.pack(side=RIGHT, fill=Y)
  
          kw.update({'yscrollcommand': self.vbar.set})
          Text.__init__(self, self.frame, **kw)
          self.pack(side=LEFT, fill=BOTH, expand=True)
          self.vbar['command'] = self.yview
  
          # Copy geometry methods of self.frame without overriding Text
          # methods -- hack!
          text_meths = vars(Text).keys()
          methods = vars(Pack).keys() | vars(Grid).keys() | vars(Place).keys()
          methods = methods.difference(text_meths)
  
          for m in methods:
              if m[0] != '_' and m != 'config' and m != 'configure':
                  setattr(self, m, getattr(self.frame, m))
  
      def gettext(self):
          """return everything in text area"""
          return self.get("0.0", "end")
  
      def settext(self, text):
          self.delete("0.0", "end")
          self.insert("end", text)
          
      def __str__(self):
          return str(self.frame)
  
      
  
  
  def example():
      from tkinter.constants import END
  
      stext = ScrolledText(bg='white', height=10)
      stext.insert(END, __doc__)
      stext.pack(fill=BOTH, side=LEFT, expand=True)
      stext.focus_set()
      stext.mainloop()
  
  if __name__ == "__main__":
      example()
  