title: How to make a custom scrollbar in tkinter for frames
body: <p>I have been using the tkinter scrollbar for my project. But, when I use the properties troughcolor, the color of the scrollbar doesn't change. So, I want to make a custom scrollbar for tkinter and python that can be used to scroll through a frame. I then will add color to this custom scrollbar. Is there any way to do so? Here is my code:</p>
  <pre><code>root=Tk()
  container = ttk.Frame(root)
  canvas = Canvas(container, highlightbackground=&quot;black&quot;, highlightthickness=1, bg=&quot;black&quot;, width=400, height=600)
  scrollbar = Scrollbar(container, orient=&quot;vertical&quot;, command=canvas.yview, troughcolor=&quot;red&quot;)
  scrollable_frame = ttk.Frame(canvas)
  scrollable_frame.bind(
      &quot;&lt;Configure&gt;&quot;,
      lambda e: canvas.configure(
          scrollregion=canvas.bbox(&quot;all&quot;)
      )
  )
  canvas.create_window((0, 0), window=scrollable_frame, anchor=&quot;nw&quot;)
  canvas.configure(yscrollcommand=scrollbar.set)
  container.pack()
  canvas.pack(side=&quot;left&quot;, fill=&quot;both&quot;, expand=True)
  scrollbar.pack(side=&quot;right&quot;, fill=&quot;y&quot;)
  root.mainloop()
  </code></pre>