Re: Emitting destroy signal
- From: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Emitting destroy signal
- Date: Sun, 04 Jul 2004 00:57:03 +1000
Jeff Franks wrote:
Russell Shaw wrote:
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);
Your emitting the destroy_event on the table, therefore only the table
is destroyed.
Hi,
I changed it to:
g_signal_emit_by_name(table,"destroy_event");
In main.c, i have:
...
Connect your exit button (swapped) to gtk_widget_destroy() like this:
g_signal_connect_swapped (G_OBJECT (button),
> "clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (window));
Jeff.
Thanks. It works now:)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]