Re: multiple data args to gtk_signal_connect



fritz jetzek wrote:
> 
> to make the question clear by code:
> 
> (example)
> 
> bla = g_string_new("asdf");
> blub = g_string_new("hi");
> 
> gtk_signal_connect(GTK_OBJECT(some_button), "clicked",
> GTK_SIGNAL_FUNC(my_func), bla, blub);
> 
> ^^^^^^^^^
> 
> illegal

Why not use a struct?

 typedef _MyParams MyParams;
 struct _MyParams 
 {
   GString *str1;
   GString *str2;
 };

 .... 

 MyParams bla;
 bla.str1 = g_string_new("asdf");
 bla.str2 = g_string_new("hi");
 
 gtk_signal_connect(GTK_OBJECT(some_button), "clicked",
 GTK_SIGNAL_FUNC(my_func), &bla);

John



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