Re: [Q] How many arguments can I use in GTK_SIGNAL_FUNC



Woo-Sick Choi <wschoi@sr.hei.co.kr> writes:

> Hi all~
> 
> Examaple 1)
> 
> gtk_signal_connect(GTK_OBJECT(clist), "select_row",
>                        GTK_SIGNAL_FUNC(selection_made),
>                        NULL);
> 
> void selection_made( GtkWidget      *clist,
>                      gint            row,
>                      gint            column,
>                      GdkEventButton *event,
>                      gpointer        data )
> {
>   .
>   .
> }
> 
> selection_made function have 5 arguments.
> but gtk_signal_connect function's last arguments is NULL.

The number of arguments depends on what signal it is ("clicked" or
"select_row").

In gtk/gtkclist.h:

struct _GtkCListClass
{
  ...
  void   (*select_row)          (GtkCList       *clist,
				 gint            row,
				 gint            column,
				 GdkEvent       *event);
  ...
}

The 4 arguments are filled by the widget, the last 1 arguments are
provided by user (the last argument of gtk_signal_connect()).

The same rule applies to your second example.

-- 
Changwoo Ryu




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