TreeCtrl Scrolling

I have been playing around with the wxRuby TreeCtrl for a couple of
weeks now and I can’t figure out how to get the scrolling to work. I
believe it has scrolling built in but I can’t get the to show up. I can
place the TreeCtrl in a ScrolledWindow and scroll around over the tree
but that breaks TreeItem visibility checks because the TreeCtrl doesn’t
know about it’s parent.
When using the TreeCtrl in the Scrolled window the scroll bars work
properly when I set the ScrolledWindow virtual size to the treectrl
client size.
But I don’t find any equivalent functionality in the treectrl itself.
I’ve tried using it’s super (window) virtual size but that doesn’t seem
to work either.
The treectrl has some interesting methods like scrollto that make me
believe it implements scrolling but I’m at a loss to make it work.
Larry

Larry Rogers wrote:

I have been playing around with the wxRuby TreeCtrl for a couple of
weeks now and I can’t figure out how to get the scrolling to work. I
believe it has scrolling built in but I can’t get the to show up. I can
place the TreeCtrl in a ScrolledWindow and scroll around over the tree
but that breaks TreeItem visibility checks because the TreeCtrl doesn’t
know about it’s parent.

That sounds strange. With TreeCtrl the scroll bars should appear when
they’re needed, and not when they’re not. It’s all handled by the widget
itself - you definitely shouldn’t need to use another control like
ScrolledWindow - just use Sizers (as in general) to manage the size of
your widgets.

If this doesn’t help, could you post a minimal, runnable sample that
reproduces the problem, and also a bit more info about your platform and
version.

a

Alex F. wrote:

Larry Rogers wrote:

That sounds strange. With TreeCtrl the scroll bars should appear when
they’re needed, and not when they’re not. It’s all handled by the widget
itself - you definitely shouldn’t need to use another control like
ScrolledWindow - just use Sizers (as in general) to manage the size of
your widgets.

If this doesn’t help, could you post a minimal, runnable sample that
reproduces the problem, and also a bit more info about your platform and
version.

a

Hi Alex,
Thanks for your reply. I am encouraged that you say it should work the
way my instincts said it should. I have tried many variations of
Frame/Pane/TreeCtrl with and without sizers at each layer. What is
different about my case is that I’m using wxSU on a Mac, which if you’re
not familiar with it is an extension to Google Sketchup to use wxRuby to
add 3rd party UI features. This is likely the source of my problem and
it points me to another approach. I should get my UI running in wxRuby
first and then adapt it to SketchUp. In doing so I will devise the
example that you asked for and if it still doesn’t work I will post
that.
Thanks for the hints.
Larry

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs