Re: [gtk-list] CCWrapper test applet




On Wed, 6 Jan 1999, Mikael Hermansson wrote:
> void cb_destroy(GtkWidget *w,MainWindow *mptr)
> {
> 	if(mptr->DestroyObject) /* In this example it should return false */
> 		delete mptr; /*so the object will not destroy in callback


> 
> 	gtk_signal_connect(GTK_OBJECT(window),"delete_event",GTK_SIGNAL_FUNC(cb_destroy),this);

A delete_event callback has to look like this:

gint delete_event_cb(GtkWidget* w, GdkEventAny* event, gpointer data)
{


}

You're calling your method on the event rather than your data. You also
need to return TRUE or FALSE, TRUE means you "handled" the event and Gtk
should not destroy the window, FALSE means Gtk will destroy the window.

Havoc




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