Re: gtk-demo
- From: Sven Neumann <sven gimp org>
- To: "Padraig O'Briain" <Padraig Obriain Sun COM>
- Cc: gtk-devel-list gnome org
- Subject: Re: gtk-demo
- Date: 20 Aug 2001 14:07:56 +0200
Hi,
"Padraig O'Briain" <Padraig Obriain Sun COM> writes:
> + changed_id = g_signal_connect (G_OBJECT (buffer),
> + "changed",
> + G_CALLBACK (update_statusbar),
> + statusbar);
> +
> + mark_set_id = g_signal_connect (G_OBJECT (buffer),
> + "mark_set", /* cursor moved */
> + G_CALLBACK (mark_set_callback),
> + statusbar);
I'd suggest using g_signal_connect_object() here so the signal handlers
are automatically removed when the statusbar is disposed. It's much
shorter and conceptually cleaner than removing the signal handlers in
a destroy signal handler. Especially since noone assures you that
"destroy" is only emitted once.
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]