Re: Trouble with delete-event



Il lun, 2003-09-01 alle 04:03, Havoc Pennington ha scritto:

> 
> It seems to work for lots of other programs... are you sure you don't
> have some other mistake? Post a small, compilable test case...
> 

I found the problem. It was due to the fact that when you click on the
close button, the window isn't destroyed, but is put below the other
windows. For some strange reason, the window list applet didn't show my
window, so it seemed that the window was deleted.

Thanks for your help.

	Giovanni

-- 
The purpose of the Smalltalk project is to provide computer support for
the creative spirit in everyone. -- Dan Ingalls, 1981
#include <gtk/gtk.h>

gboolean on_delete (GtkWidget* widget, GdkEvent* event, gpointer user_data)
{
	g_print("Deleting...");

	return TRUE;
}

int main (int argc, char* argv[])
{
	GtkWidget* window;

	gtk_init(&argc, &argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

	g_signal_connect(GTK_OBJECT(window), "delete-event", GTK_SIGNAL_FUNC(on_delete), NULL);

	gtk_widget_show(window);

	gtk_main();

	return 0;
}


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