Re: gtk-demo



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]