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.
> -----Original Message-----
> From: Andreas Scherf [mailto:scherfa fh-trier de]
> Sent: Wednesday, September 12, 2001 7:47 PM
> To: gtk-list gnome org
> Subject: signal_connect ??
>
>
> Hello , i have a problem with gtk_signal_connect ..
> i try to copy the String "Bye" (example) to thefunction
> file_quit_cmd_callback ...
> ...
> gtk_signal_connect (GTK_OBJECT (main_window), "delete_event",
> GTK_SIGNAL_FUNC (file_quit_cmd_callback),
> (gpointer) "Bye");
> gtk_widget_show (main_window);
> ---
> void
> file_quit_cmd_callback (GtkWidget * widget, gpointer data)
> {
> g_print ("%s\n", (gchar *) data);
> gtk_exit (0);
> }
> ---
> But the String was empty if i try to print it ... where is the problem
> here ?
> Thanks
> --
> ICQ: 52910964
> scherfa fh-trier de
> scherfa web de
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>