title: tkinter: simple scrollable text
body: <h1>Question</h1>
  
  <p>I'm trying to make a 'ttk Label' which a) is 20 pixels high by 300 pixels wide, b) is scrollable (in this case horizontally), and c) uses the simplest code possible within reason (except for the fact that the text and scrollbar are both within a frame*). I've found stackoverflow to be helpful in describing the processes I need to go through (put the label in a frame, put the frame in a canvas, put the scroll bar next to or underneath the canvas and 'bind' them together somehow), but despite looking at a fair few docs and stackoverflow questions, I can't figure out why my code isn't working properly. Please could someone a) update the code so that it satisfies the conditions above, and b) let me know if I've done anything unnecessary? Thanks</p>
  
  <p>*the frame will be going in a project of mine, with text that is relevant</p>
  
  <h1>Current code</h1>
  
  <pre><code>import tkinter as tk
  from tkinter import ttk
  
  root = tk.Tk()
  
  myframe_outer = ttk.Frame(root)
  mycanvas = tk.Canvas(myframe_outer, height=20, width=300)
  myframe_inner = ttk.Frame(mycanvas)
  myscroll = ttk.Scrollbar(myframe_outer, orient='horizontal', command=mycanvas.xview)
  mycanvas.configure(xscrollcommand=myscroll.set)
  
  myframe_outer.grid()
  mycanvas.grid(row=1, sticky='nesw')
  myscroll.grid(row=2, sticky='ew')
  mycanvas.create_window(0, 0, window=myframe_inner, anchor='nw')
  ttk.Label(myframe_inner, text='test ' * 30).grid(sticky='w')
  
  root.mainloop()
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <h1>Current result</h1>
  
  <p><img src="https://i.stack.imgur.com/ib9z5.jpg" alt="enter image description here"></p>