# Scrollbar question

**URL:** <https://forum.juce.com/t/scrollbar-question/3869>\
**Category:** General JUCE discussion\
**Created:** [April 28, 2009, 3:12pm UTC](https://forum.juce.com/t/scrollbar-question/3869 "2009-04-28T15:12:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [April 28, 2009, 3:12pm UTC](https://forum.juce.com/t/scrollbar-question/3869/1 "2009-04-28T15:12:39Z")

</div>

Hi,

Is there a way to derivate a ScrollBar in order to make it “resizable”.  
As you find in Samplitude e.g., there is adaptative scrollbar that change the size of the object in track, and thus allow user to define by himself the viewed zone in e.g. a viewport.

thx

---

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [April 28, 2009, 3:32pm UTC](https://forum.juce.com/t/scrollbar-question/3869/2 "2009-04-28T15:32:26Z")

</div>

To be a bit clearer in my question,

I’d like to invert a ScrollBar behaviour in the viewport :

- currently, when the viewed component growth, the scrollBar limits change and scrollBarButton becomes smaller.

- i’d like to allow user to change the ScrollBarButton in order to change the viewed component size, do u see ?

Any help will be welcome!

Thanks

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 28, 2009, 4:42pm UTC](https://forum.juce.com/t/scrollbar-question/3869/3 "2009-04-28T16:42:17Z")

</div>

You’d need to write a specialised component for that, I think.

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [April 29, 2009, 9:36am UTC](https://forum.juce.com/t/scrollbar-question/3869/4 "2009-04-29T09:36:12Z")

</div>

yes you must write a special component for that.

anyway i don’t know if this can be useful for you too, but i modified the ViewPort class that now accepts ViewportListeners, so you can be notified when a inner component changes or the visible area changes (so you can update external Components too like your scrollbars or mini windows), look here

[http://code.google.com/p/juced/source/browse/trunk/juce/src/juce\_appframework/gui/components/layout/juce\_Viewport.h](http://code.google.com/p/juced/source/browse/trunk/juce/src/juce_appframework/gui/components/layout/juce_Viewport.h)

and

[http://code.google.com/p/juced/source/browse/trunk/juce/src/juce\_appframework/gui/components/layout/juce\_Viewport.cpp](http://code.google.com/p/juced/source/browse/trunk/juce/src/juce_appframework/gui/components/layout/juce_Viewport.cpp)

cheers !

---

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [April 29, 2009, 1:07pm UTC](https://forum.juce.com/t/scrollbar-question/3869/5 "2009-04-29T13:07:49Z")

</div>

Great Kraken,  
but I’ve already made my own viewport to add slider next to the 2 scrollbars , allowing zooms. 😉  
But such CHI solution is not actually great, today many sequencers allow you  
resizing the scrollbar button, and you keep 2 buttons + and - , instead of a scrollbar + a slider + 2 buttons.  
Moreover you can so manage the main zooming with one only object, and not 2.

(But I download it though, interesting)

Another idea ?
