Re: Viewports and scrollbars



Lars Luthman wrote:

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

Maybe you should derive your widgets from Gtk::Layout - that's somekind of drawing area with native scolling support http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Layout.html

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 <http://www.d.kth.se/%7Ed00-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 <http://www.d.kth.se/%7Ed00-llu/pgp_key.php>
Fingerprint: FCA7 C790 19B9 322D EB7A  E1B3 4371 4650 04C7 7E2E

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org <mailto:>
http://mail.gnome.org/mailman/listinfo/gtkmm-list





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