No Horizontal scrollbar with TreeView?


#1

Hi
I"ve noticed that when using a treeview, i never get a horizontal scrollbar…
it might be something i’m doing wrong (though i can’t figure what, i’m prettymuch just using the base class).
i didn’t dig too deeply into the code, but it seems that the horizscrollbar thinks isVisible() is true…

thoughts?

thanks.


#2

That’s a problem for me too.

ISTR the horizontal scroll bar works fine if you aren’t using components for the tree items, so I’m guessing you are, right?

I need drag and drop, so I need to use custom item components, but if you don’t, try just overriding paintItem() instead.


#3

ok

what does ISTR mean?

i’m not using components – just overriding paint…


#4

I seem to recall/remember

[quote]
i’m not using components – just overriding paint…[/quote]

Hmmm, I’m pretty sure my treeview had a horizontal scrollbar when I was just overriding the paint method, but broke when I switched to components. That was a while back though, so I may be remembering wrongly, or something may have changed in JUCE.

That said, this thread: http://www.adbe.org/juceforum/viewtopic.php?t=579

seems to suggest it simply doesn’t work at the moment.


#5

If you had used search, I brought this up before, but before I did so I examined the code for the treeview. :stuck_out_tongue:

Basically, with how it works right now, it cannot know the width of things, due to that they draw themselves; so I proposed adding a function to the treeviewitem class that returns a preferred width, something like int getPreferredWidth() or something, which of course would be updated with the tree is redrawn or whatnot.


#6