# Scrolling \`racket/gui\` panels with the mouse

**URL:** <https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957>\
**Category:** Questions & Answers\
**Tags:** gui\
**Created:** [May 2, 2022, 9:25pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957 "2022-05-02T21:25:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [May 2, 2022, 9:25pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957/1 "2022-05-02T21:25:18Z")

</div>

[More context](https://github.com/Bogdanp/racket-gui-easy/issues/15)

Tagging @bogdan so they can follow the thread.

What would it take for `racket/gui`'s panels to be scrollable via the mouse (_i.e._, without having to click and drag the scrollbar)? Bogdan has suggested `racket/gui` needs an update for this because, while there are ways to get the scroll events, there is no way to control the scroll position. Of course, DrRacket's editor area behaves appropriately—possibly there is some code in the editor class hierarchy that can be ported over towards the panels?

I would be willing to donate some time to help with this, with the major caveat being that I am not a `racket/gui` or `racket/class` expert.

---

<div class="post-metadata">

**Author:** ![alexh](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/alexh/32/315_2.png) [@alexh](https://racket.discourse.group/u/alexh)\
**Post date:** [May 2, 2022, 9:43pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957/2 "2022-05-02T21:43:46Z")

</div>

I looked at the "more context" link you provided, and I can tell that `list-view%` definitely supports scrolling via the mouse, I use that feature in my application quite a lot.

I am using Windows, perhaps this is platform specific, or you mean something else?

EDIT: looks like I misread your comment, I was thinking about `list-box%`, you are talking about `list-view` from the gui-easy package.

Alex.

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [May 2, 2022, 9:49pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957/3 "2022-05-02T21:49:33Z")

</div>

I would really love this! Here's a version I [reported on the mailing list](https://groups.google.com/g/racket-users/c/WdnBP-TeMV0/m/YaoEUw2QDgAJ)—I noted at the time that "Dr. Racket's `Colors>Color Schemes` preferences tab also does not scroll in response to the mouse/trackpad"—and here's a GitHub issue: [Panels/Frames do not respond to scrolling · Issue #68 · racket/gui · GitHub](https://github.com/racket/gui/issues/68)

---

<div class="post-metadata">

**Author:** ![alexh](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/alexh/32/315_2.png) [@alexh](https://racket.discourse.group/u/alexh)\
**Post date:** [May 2, 2022, 10:46pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957/4 "2022-05-02T22:46:57Z")

</div>

Reading through that old groups discussion, I remember that I did some more investigations since than. Basically a scrollable `panel%` is implemented by `racket/gui` using an underlying `canvas%` object, not using the OS level panel classes, so the implementation could be extended to support scrolling using the mouse, although special care needs to be taken to pass scroll events to the underlying widgets inside the panel (for example when having a text editor inside a scrollable panel)

Alex.
