title: Tkinter canvas & scrollbar with grid
body: <p>I have a canvas in a frame</p>
  <pre><code>photoFrame = Frame(centerFrame, width=250, height=190, bg=&quot;#EBEBEB&quot;)
  photoFrame.grid(row=0, column=1, sticky=&quot;nsew&quot;)
  photoCanvas = Canvas(photoFrame, bg=&quot;#EBEBEB&quot;)
  photoCanvas.grid(row=0, column=0, sticky=&quot;nsew&quot;)
  </code></pre>
  <p>and I try to put a scrollbar to my canvas with this</p>
  <pre><code>photoScroll = Scrollbar(photoFrame, orient=VERTICAL)
  photoScroll.config(command=photoCanvas.yview)
  photoCanvas.config(yscrollcommand=photoScroll.set)
  photoScroll.grid(row=0, column=1, sticky=&quot;ns&quot;)
  </code></pre>
  <p>The scrollbar appears but it's disabled. Can you help me please ?</p>
  <p>Sorry for my bad english.</p>
  <p>In a for loop I add lots of Image button with this code</p>
  <pre><code>element = Button(photoCanvas, image = listPhotos[i], borderwidth=0, height = 200, width = 200, bg=&quot;#EBEBEB&quot;)
  element.grid(row=rowPhoto, column=columnPhoto, padx=5, pady=5, sticky=&quot;nsew&quot;)
  </code></pre>
  <p>Finnally I have this</p>
  <pre><code>    root = Tk()    
      photoFrame = Frame(root, width=250, height=190, bg=&quot;#EBEBEB&quot;)
          
  
      photoCanvas = Canvas(photoFrame, bg=&quot;#EBEBEB&quot;)
      photoCanvas.grid(row=0, column=0, sticky=&quot;nsew&quot;)
      
      for i in range(0, len(listPhotos), 1):
         element = Button(photoCanvas, image = listPhotos[i], borderwidth=0, height = 200, width = 200, bg=&quot;#EBEBEB&quot;)
         element.grid(row=rowPhoto, column=columnPhoto, padx=5, pady=5, sticky=&quot;nsew&quot;)
      
      photoScroll=Scrollbar(photoFrame,orient=VERTICAL)
      photoScroll.config(command=photoCanvas.yview)
      photoCanvas.config(yscrollcommand=photoScroll.set)
      photoScroll.grid(row=0, column=1, sticky=&quot;ns&quot;)
  </code></pre>
  <p>in my app, the purple rectangle is the next frame and I need a vertical scrollbar
  <a href="https://i.stack.imgur.com/7y5Wq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7y5Wq.png" alt="enter image description here" /></a></p>
  <p>Say if you have some questions</p>