Re: Viewports and scrollbars



> On Sat, 2004-12-18 at 21:36 +0100, Lars Luthman wrote:
>> Does anyone know how to do this? The custom widgets may resize
>> themselves at any time too. I have a sketch of what I want here:
>>
>> http://www.d.kth.se/~d00-llu/dino/figure3.png
>>
>> The horizontal scrollbar should control both viewports, and the vertical
>> should only control the upper viewport (there are no viewports there, I
>> couldn't insert them in glade).
>
> OK, I managed to solve this after looking through the GTK+ source code
> for GtkScrolledWindow - I simply derived a new class from
> ScrolledWindow, set its policies to POLICY_NEVER, and wrote a
> on_size_request() function that sets the requested size to 0, ignoring
> the size of the child widget (except for the bottom widget, where I use
> ScrolledWindow::on_size_request() to get the height). Then I set the
> adjustments of the scrollbars to the adjustments of my derived scrolled
> windows.

If you want scrollbars from one ScrolledWindow to control the other
ScrolledWindow, then you should probably investigate sharing the
hadjustment and vadjustment. There are get and set methods.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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