Re: GTK 2.0 signal connecting



On Fri, Jun 28, 2002 at 01:01:36PM +0200, Olaf Fr?czyk wrote:
Hi,
As I see, gtk_signal_connect is deprecated.
But description of new functions g_signal_connect.... is rather poor.
What is the difference between g_signal_connect and
g_signal_connect_swapped?

  gtk_signal_connect(GTK_OBJECT(button), "clicked",
                     GTK_SIGNAL_FUNC(callback), data);
    should be replaced by:
  g_signal_connect(G_OBJECT(button),  "clicked",
                   G_CALLBACK(callback),  data);

     and
  gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
                            GTK_SIGNAL_FUNC(callback),
                            GTK_OBJECT(data));
    is to be replaced by:
  g_signal_connect_swapped(G_OBJECT(button), "clicked",
                           G_CALLBACK(callback), data);

  When a signal is connected by g_signal_connect_swapped(), the first
and last arguments of the callback will be swapped, hence the name of
this function. gtk_signal_connect_object() was a bad name to describe
this behaviour.

   HTH,

        DindinX


-- 
David dindinx org
"This is my gift, it is my curse."



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