Re: Hiding scrollbars for GtkScrolledWindow



Hey there,
I'm trying to use a GtkScrolledWindow with the capability of scrolling,
but not displaying scroll bars (so the content has the appropriate
height). I need this behaviour, because I am using a small touch display
and handle the scrolled with bigger and easier to push buttons.

If I set the scrollbars' policy to never, the scrollbar is not
displayed, but the window is not as small as I want it, but as big as
its content. I want it to have the same size as with scrollbars, but
without displaying them.

Somebody has a clue on how to achieve this?

Hi:

I really doubt you'll get some success with GtkScrolledWindow. You should try with GtkViewport, now for this to work, you can't set GtkViewport to hexpand, nor vexpand, cause it will then expand to the full size of it's children. the best I manage to do, was wrap a GtkViewport in a custom container, and force it's preferred size to be minimum (hardcoded :) )

Look at this implementation [1]: The code is from a widget I'm using in Calendar, and as you see, I'm showing the scrollbars, but the good thing is that you don't need those, so you can remove it. Tweak it to your convenience.

Hope it helps, cheers


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]