Re: delete_event



Hi,

Generating a delete event would look something like this:

  /* Synthesize delete_event to close dialog. */
  
  GdkEventAny event;
  GtkWidget *widget;

  widget = GTK_WIDGET (dialog);
  
  event.type = GDK_DELETE;
  event.window = widget->window;
  event.send_event = TRUE;
  
  g_object_ref (G_OBJECT (event.window));
  
  gtk_main_do_event ((GdkEvent*)&event);
  
  g_object_unref (G_OBJECT (event.window));

The above is for GTK 2; to backport to GTK 1.2 I think you just need
to replace g_object_ref with gdk_window_ref, and similar for unref.

Havoc



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