[164] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: Notebook and listbox problems.
daemon@ATHENA.MIT.EDU (Owen Taylor)
Thu May 15 16:54:59 1997
From: Owen Taylor <owt1@cornell.edu>
To: gtk-list@redhat.com
In-reply-to: Your message of "Wed, 14 May 1997 16:26:03 EDT."
<199705142026.QAA05782@lacrosse.redhat.com>
Date: Wed, 14 May 1997 16:55:15 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
> Hmm. Then if I change the gtk_signal_connect_object in simple.c
> to a gtk_signal_connect, it should only get rid of the button,
> not the whole window, right? Or do I misunderstand?
>
> I changed simple.c so that
> gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
> GTK_SIGNAL_FUNC (gtk_widget_destroy),
> GTK_OBJECT (window));
> became
> gtk_signal_connect (GTK_OBJECT (button), "clicked",
> GTK_SIGNAL_FUNC (gtk_widget_destroy),
> GTK_OBJECT (window));
> and the behavior of the program stayed exactly the same.
That's because simple.c does some strange stuff ...
button = gtk_button_new_with_label ("Hello World");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (hello), NULL);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
So two signals are connected. The hello() function calls gtk_exit so the
second callback, which you modified, is never activated. If you remove
the gtk_exit call from hello(), then you'll see the expected behavior.
I don't know what this was intended to demonstrate ...
Owen
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null