# Viewport request: set ScrollBars always visible

**URL:** <https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179>\
**Category:** General JUCE discussion\
**Created:** [August 14, 2009, 10:51am UTC](https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179 "2009-08-14T10:51:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![friscokid](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@friscokid](https://forum.juce.com/u/friscokid)\
**Post date:** [August 14, 2009, 10:51am UTC](https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179/1 "2009-08-14T10:51:33Z")

</div>

Hi,  
I have a request regarding the ScrollBar behaviour of the Viewport class:  
It would be nice to have an option to keep the ScrollBars always visible, even if there is nothing to scroll. In this way, a ScrollBar could act as a kind of separator, too, like it is done in the Mac OSX finder (see the picture).

![](http://www.mind-crafted-gear.de/privateFiles/OSX_Finder.jpg)

I’ve changed the Viewport class to do that and it’s not that much work, but it would be cool to have it in the official juce tip.  
What do you think of it?

---

<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:** [August 14, 2009, 11:13am UTC](https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179/2 "2009-08-14T11:13:42Z")

</div>

Yes, not a bad idea…

---

<div class="post-metadata">

**Author:** ![friscokid](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@friscokid](https://forum.juce.com/u/friscokid)\
**Post date:** [August 19, 2009, 9:18pm UTC](https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179/3 "2009-08-19T21:18:46Z")

</div>

Ok, I found out that almost the whole thing is already there.  
You can simply call

```auto

```

But for TreeViews or similar Components it only works if there is some item added to the ViewPort. If a TreeView has no items, the ScrollBars aren’t shown. As soon as the first item is added, the Scrollbars appear.

---

<div class="post-metadata">

**Author:** ![vishvesh](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vishvesh](https://forum.juce.com/u/vishvesh)\
**Post date:** [August 21, 2009, 3:51am UTC](https://forum.juce.com/t/viewport-request-set-scrollbars-always-visible/4179/4 "2009-08-21T03:51:22Z")

</div>

I have similar UI requirements most of the times , and I end up painting the scroll Bar, which shows up when Viewport class doesn’t create scroll bar. This option would be very useful. 😛
