Re: destroy-event ???



Paul Davis wrote:
> 
> >Hi all,
> >
> >I don't know what signal is emited in the following situation.
> >
> >Right-click in the upper-right corner on a X window. A menu appears.
> >There is a destroy option. Selecting this option will emit a
> >"destroy-event" to that window? If yes, I want to catch it(from my gtk
> >app., if posible), but I don't know how.
> 
> it will generate a "delete_event" first, which is what actually
> corresponds to the window manager's "destroy" operation.
> 
> if that is not handled by a handler that returns TRUE, then the widget
> in question will more or less immediately be "destroyed" in the GTK+
> sense, which involves returning it to an uninitialized state. this is
> accompanied by a "destroy_event" for the window.
> 
> --p

Hi,
It works for delete option but not for destroy.
Here is my code.
Am I doing something wrong?


void main()
{
...

  AddWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (AddWindow), "AddWindow", AddWindow);
  gtk_widget_set_usize (AddWindow, 427, 371);
  gtk_window_set_modal (GTK_WINDOW (AddWindow), TRUE);
  gtk_window_set_policy (GTK_WINDOW (AddWindow), FALSE, FALSE, FALSE);

  /* catch the delete event */
  gtk_signal_connect(GTK_OBJECT (AddWindow), "delete_event",
GTK_SIGNAL_FUNC (DestroyEventHandler), NULL);

...
return;
}


int DestroyEventHandler(GtkWidget * widget, GdkEvent *event, gpointer
data)
{
	

  return TRUE;
}




Thanks again

> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list



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