Re: Viewports and scrollbars

Lars Luthman wrote:

I have two custom widgets derived from DrawingArea that I want to be

Maybe you should derive your widgets from Gtk::Layout - that's somekind of drawing area with native scolling support

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: <>

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: <>
Fingerprint: FCA7 C790 19B9 322D EB7A  E1B3 4371 4650 04C7 7E2E

gtkmm-list mailing list
gtkmm-list gnome org <mailto:>

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