Search code examples
pharo

Pharo: how can I change number of lines per one scroll in Playground?


When I scroll with the mouse's scrolling wheel, one turn of the wheel (the minimum step of scrolling) scrolls the text in Playground for approximately 7-8 lines. This is too much; I would like scrolling to be more continuous. How can I change it?


Solution

  • This is nothing but a hack, rather than the right way to do it but what I've found is this:

    vSetScrollDelta
      |pd|
      pd := self vPageDelta.
      self vScrollbar
        scrollDelta: pd / 50 "<- added / 50"
        pageDelta: pd;
        interval: self vScrollbarInterval;
        setValue: self vScrollbarValue
    

    EDIT

    I kept thinking that this answer would have been more useful if I told how I found the method above. It was really easy, and took me some few minutes (even though I'm not a Pharo user)

    1. To get started I wrote down the word scroll. This was an obvious choice because the problem was about scrolling, right?

    2. Then right-clicked to get the menu:

    enter image description here

    1. The selectors containing it command took me to this list

    enter image description here

    1. In that list the class GeneralScrollPane appeared many times so I browsed it. There I found the method vScrollbarInterval which looked promising. Right-clicked again to get its senders and vSetScrollDelta popped up, so I gave it a try.