[148] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: Notebook and listbox problems.
daemon@ATHENA.MIT.EDU (Michael K. Johnson)
Wed May 14 16:29:25 1997
To: gtk-list@redhat.com
From: "Michael K. Johnson" <johnsonm@redhat.com>
In-reply-to: Your message of "13 May 1997 12:47:17 EDT."
<lzohaf8gkq.fsf@cu-dialup-2004.cit.cornell.edu>
Date: Wed, 14 May 1997 16:26:03 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
Owen Taylor writes:
>If you call gtk_signal_connect, then on a callback, widget is
>set to the object to which you are connecting the object, and
>data is whatever you specify as the fourth argument.
>(That's why the first try with gtk_signal_connect destroyed
>the button.)
>
>If you call gtk_signal_connect_object, then regardless of the
>object you are connecting to, the widget argument to the callback
>is set to the _fourth_ argument of gtk_signal_connect_object.
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.
I added a second button in a vbox, so that there would be something
left in the window after the button was destroyed in case the window
was closing down because it had no contents, but that had no effect
on this behavior.
Now, when I add two buttons, and want to destroy one of them by
clicking the other, it only works if I use gtk_signal_connect_object,
as expected. If I only use gtk_signal_connect, I destroy the button
clicked instead of the "target" button. So I really don't understand
why the changes to the original version with one button didn't have
the effect I expected...
Could someone elucidate?
Thanks!
michaelkjohnson
"Ever wonder why the SAME PEOPLE make up ALL the conspiracy theories?"
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null