[10444] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] RE: A dumb question about gtk_widget_destroy().

daemon@ATHENA.MIT.EDU (Rostedt, Steven)
Wed Nov 25 12:57:05 1998

Date: Wed, 25 Nov 1998 12:34:25 -0500
From: "Rostedt, Steven" <steven.rostedt@lmco.com>
To: "'serge@physics.unc.edu'" <serge@physics.unc.edu>
Cc: "'GTK-List'" <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com




> Hi!
> It must be a really dumb question but... Here is a piece of code from
> testgtk (from 1.0.5):
> 
	"the only dumb question is the one that is not asked"

>   button = gtk_button_new_with_label ("close");
>   gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
>                              GTK_SIGNAL_FUNC(gtk_widget_destroy),
>                              GTK_OBJECT (window));
> 
> However, looking at gtkwidget.h, I see that gtk_widget_destroy() only has
> one argument, so the above piece of code should destroy the button
> itself, not the whole window. It does exactly that when I program it
> like this, but it works in testgtk.
> 
	The gtk_signal_connect_object is different from the 
	gtk_signal_connect.  

	The callback prototype is 
	      void callback_func ( GtkObject *object)
	where the object is the last parameter of the
	gtk_signal_connect_object.

	gtk_signal_connect would pass the button.


> Am I in sane? Thanks.
> 
> 			Sergei
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
> /dev/null

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post