Re: ScrolledWindow - how to allow scrolling only in one direction?



Tom,

I'm a bit busy so I don't have time to write actual code and test, but
the basic idea would be to override Gtk::Container::on_add() in
VScrolledWindow.  When a widget is added, connect to the child's
on_size_request() signal and whenever this event is fired you should
call queue_draw() on the VScrolledWindow. You'll also have to override
on_remove() so you can disconnect the signal handler as well.

If you need me to be more clear or you're having problems, send me
something compilable and I'll take a quick look.

HTH,
Paul Davis

On 4/2/07, Tom Bachmann <e_mc_h2 web de> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Davis schrieb:
> You can inherit from Gtk::ScrolledWindow and override its
> on_size_request function.
>
> [code]
>
> I based this on the example here:
> http://svn.gnome.org/viewcvs/gtkmm/trunk/examples/book/custom/custom_container/
>

Thanks very much, the code is indeed working. There's only one point
where VScrolledWindow does not behave as expected: When the wrapped
widget changes it's size (e.g. becaus the wrapped wigdet is a vbox and a
larger button is added), this change is not reflected by the
VScrolledWindow. I looked through the example (though I didn't build it)
and I could not find code that would do this. What is to be added to
make this work as well?
- --
- -ness-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGEULbvD/ijq9JWhsRAgHcAJ9JAfUdlIHIZkbDRAvF1SNBOkr/9QCfel/C
31ALP/AkGgWbGZmW/hRZ/GA=
=BV9T
-----END PGP SIGNATURE-----
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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