Viewports and scrollbars



I have two custom widgets derived from DrawingArea that I want to be
scrollable. I want the first widget to be scrollable both horizontally
and vertically, and the second should only be scrollable horizontally,
using the same scrollbar as the first widget. I suppose the way to do
this is to put both widgets in Viewports and connect the scrollbars to
the viewports somehow, but I'm not sure how to do this. I've tried just
setting the adjustments of the viewports to the adjustments of the
scrollbars, but then the viewports always grow to the size of their
child widgets, so I don't get any scrolling at all.

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).

-- 
Lars Luthman
PGP key:     http://www.d.kth.se/~d00-llu/pgp_key.php
Fingerprint: FCA7 C790 19B9 322D EB7A  E1B3 4371 4650 04C7 7E2E

Attachment: signature.asc
Description: This is a digitally signed message part



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