Re: GtkBuilder Public API - Last call



On Wed, 13 Jun 2007, Johan Dahlin wrote:

Christian Persch wrote:
Hi;

Le mercredi 13 juin 2007 à 11:07 -0300, Johan Dahlin a écrit :
Is there are reason to prefer glade_xml_signal_connect[data] to the
connect_signals() api? Assuming we add a user data argument to
connect_signals, see separate discussion.

I don't think we need a separate connect_data if we add that user_data
argument. CONNECT_SWAPPED still needs to be handled in this case,
however.

I can't see a use case where sending in a user_data and CONNECT_SWAPPED at
the same time makes sense. Do you know of one?

"swapped" *only* makes sense in connection with user_data on signal
connections. e.g.:

  FILE *file = fopen ("/tmp/foo", "w");
  g_signal_connect_swapped (button, "destroy", G_CALLBACK (fclose), file);

for GObject*s, you need g_signal_connect_object to disconnect the handler
when either obejct dies (window or button):

  g_signal_connect_object (button, "clicked", G_CALLBACK (gtk_widget_destroy), window, G_CONNECT_SWAPPED);

Johan

---
ciaoTJ


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