Re: Scrolling a Tree View before it's realized
- From: tomas tuxteam de
- To: Attilio Fiandrotti <attilio fiandrotti gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Scrolling a Tree View before it's realized
- Date: Sat, 11 Nov 2006 12:44:11 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, Nov 11, 2006 at 11:51:20AM +0100, Attilio Fiandrotti wrote:
Attilio Fiandrotti wrote:
Hi
In an application i add many items to a ListStore and make it scroll on
the fly to the default option row, like this
[...]
I eventually managed this by scrolling the treeview from a callback that
gets fired after the expose event is fired.
In order to have scrolling performed only the first time expose event is
fired, i use a global flag which i reset from inside the callback the
first time it's run.
I now would like to know if there is a way to run a signal handler only
once and without using a second signal handler or global flags.
You just might want to call g_signal_handler_disconnect from whithin the signal
handler. You'll have to stash the handler ID you get from
g_signal_connect() somewhere accessible from the handler (for example in
the user data struct).
OTOH, g_signal_add_emission_hook() seems to be the function made for
you :)
In an emission hook function you just return FALSE if you want the hook
to be removed. You'll have to check whether your particular signal
accepts emission hooks, though.
HTH
- -- tomÃs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFFVcWbBcgs9XrR2kYRAk3UAJ9oIricfwjX9IEnJlt9mK5UET3KAwCcDo88
i+DwGPKPRpIrpaGsZQnYo4k=
=RtUR
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]