Re: signal_connect ??
- From: Andreas Scherf <scherfa fh-trier de>
- To: Esteban Quijano Vincenzi <Esteban Quijano artinsoft com>
- Cc: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: signal_connect ??
- Date: Thu, 13 Sep 2001 10:58:14 +0200
> Esteban Quijano Vincenzi wrote:
>
> ok, if you see the API reference:
> http://developer.gnome.org/doc/API/gtk/gtkwidget.html#GTKWIDGET-DELETE-EVENT
>
> you will see that the callback function receives 3 parameters instead
> of two:
>
> WRONG:
>
> void
> file_quit_cmd_callback (GtkWidget * widget, gpointer data)
> {
> g_print ("%s\n", (gchar *) data);
> gtk_exit (0);
> }
>
> RIGHT:
>
> void
> file_quit_cmd_callback (GtkWidget * widget, GdkEvent *event, gpointer
> data)
> {
> g_print ("%s\n", (gchar *) data);
> gtk_exit (0);
> }
>
> In the wrong code, you are interpreting the event pointer as a string.
> Don't forget to put the middle parameter no matter if you're not gonna
> use it.
>
> Hope it helps,
>
> Esteban Quijano Vincenzi
> Artinsoft corp.
But the compiler says :
menubar.c:74: warning: passing arg 2 of `file_quit_cmd_callback' from
incompatible pointer type
menubar.c:74: too few arguments to function `file_quit_cmd_callback'
Dont know if that could be the right thing ?
Scherfy
--
ICQ: 52910964
scherfa fh-trier de
scherfa web de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]