# Scrollbar problems on Windows

**URL:** <https://racket.discourse.group/t/scrollbar-problems-on-windows/3314>\
**Category:** Questions & Answers\
**Created:** [November 13, 2024, 4:12pm UTC](https://racket.discourse.group/t/scrollbar-problems-on-windows/3314 "2024-11-13T16:12:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jjsimpso](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jjsimpso/32/602_2.png) [@jjsimpso](https://racket.discourse.group/u/jjsimpso)\
**Post date:** [November 13, 2024, 4:12pm UTC](https://racket.discourse.group/t/scrollbar-problems-on-windows/3314/1 "2024-11-13T16:12:12Z")

</div>

In my GUI application, I have a number of scrollbar-related problems in Windows that I don't see on Linux. My app has a custom `canvas%` with manual scrollbars.

The main problem occurs when scrolling a very large virtual canvas (\> 30,000 pixels high or so). Scrolling via dragging the scroll thumb(?) seems to work as expected until I release the left mouse button. At that point I see an `on-scroll` event with a bogus position in the `event` argument. It kinda seems like an integer overflow issue at around 32,768 but it isn't super consistent. Scrolling via `set-scroll-pos` works fine even with very large values.

I can easily have a virtual canvas with dimensions \> 500,000 pixels, so this is a problem.

On a more general note, I've implemented scrolling using units of pixels. Is that how manual scrollbars were intended to be used? I suppose I could use a larger unit, but with the sizes I deal with I expect I will still run into this issue if I keep any degree of fine-grained scrolling.

Note: it looks like the 32,000 limit is a known issue. See this commit:  
[https://github.com/racket/gui/commit/4ad479277821641fb39b8ae8e9c20a76b36e9e9a](https://github.com/racket/gui/commit/4ad479277821641fb39b8ae8e9c20a76b36e9e9a)

Also, see an issue I previously opened concerning the limit to `set-scroll-range`:  
[https://github.com/racket/gui/issues/295](https://github.com/racket/gui/issues/295)

Any thoughts or suggestions are appreciated!

---

_[View the full topic](https://racket.discourse.group/t/scrollbar-problems-on-windows/3314)._
