title: Tkinter | How to detect tkinter scrollbar position near the end
body: <p>I know that you can get the scrollbar position if I bind the frame the scrollbar is controlling to a function (<code>onFrameConfigure</code>) like this: <code>self.calendar_frame.bind("&lt;Configure&gt;", self.onFrameConfigure)</code>, and from the <code>event</code> in the <code>onFrameConfigure(self, event):</code> I can get <em>some</em> x value of the scroll bar <code>event.x</code>. I thought the value was showing the location of the scrollbar in px so with that logic if I scroll to the maximum right side, I should get the same value (or similar value) as the width of the scrollbar but from the test below I got otherwise:</p>
  
  <pre><code>event.x: -640 | scrollbar.winfo_width(): 382
  event.x: -415 | scrollbar.winfo_width(): 607
  event.x: -245 | scrollbar.winfo_width(): 777
  event.x: -713 | scrollbar.winfo_width(): 309
  </code></pre>
  
  <p>(the result above are only when the scrollbar is to the <strong>maximum right</strong>)</p>
  
  <p>Don't see any way to use those value to determine whether the scrollbar is at the <strong>right end</strong>.</p>
  
  <p>My question is: <em>how can I detect when the scrollbar reached the end of one of the end-of-the-scrollbar?</em></p>
  
  <p>Even better would be to detect when the scrollbar is <strong>near</strong> the end because for my purpose (read the purpose of my project here: <a href="https://stackoverflow.com/questions/53891974/tkinter-custom-widget-infinite-horizontal-scrolling-calendar">here</a>) I need something to trigger right before the scrollbar reach it maximum end.</p>