Emitting destroy signal
- From: Russell Shaw <rjshaw netspace net au>
- To: gtk-app-devel-list gnome org
- Subject: Emitting destroy signal
- Date: Sat, 03 Jul 2004 21:12:37 +1000
Hi,
I made a composite widget (Table) that inherits from GtkVbox.
I packed this into a GtkWindow in main.c When the "exit" button
is clicked in the Table widget, on_exit_clicked is called (in table.c),
which emits "destroy_event":
static void
on_exit_clicked(GtkWidget *button, gpointer data)
{
Table *table=(Table*)data;
g_signal_emit_by_name(table,"destroy_event",0/*detail*/,NULL);
}
In main.c, i have:
static gboolean
destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
gtk_widget_destroy(widget);
}
.
.
main()
{
...
GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
Table *table=table_new();
gtk_container_add(GTK_CONTAINER(window),table);
g_signal_connect(table,"destroy_event",G_CALLBACK(destroy_cb),window);
...
}
When the exit button in the table widget is clicked, the table widget
is destroyed, but its parent container (a GtkWindow) remains. How do
i get that to be destroyed too?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]