Re: Destroy Signal



On Sun, Mar 04, 2001 at 11:02:44PM +0100, Sven Neumann wrote:
> Hi,
> 
> Jeff Shipman <shippy nmt edu> writes:
> 
> > I think this should work:
> > 
> > gtk_widget_connect_object(GTK_OBJECT(mydialog), "delete_event",
> >                           GTK_SIGNAL_FUNC(gtk_widget_hide),
> >                           GTK_OBJECT(mydialog));
> > 
> 
> It should work, but the simpler 
> 
> gtk_widget_connect (GTK_OBJECT (mydialog), "delete_event",
>                     GTK_SIGNAL_FUNC (gtk_widget_hide),
>                     NULL);
> 
> should do as well since the signal handler is called with the
> emitting object as the first parameter which happens to be 
> the correct pointer in this special case.
> 
> 

gtk_widget_hide returns void :-)
does C99 include anonymous functions? *g*
gtk_widget_connect (GTK_OBJECT (mydialog), "delete_event",
		    GTK_SIGNAL_FUNC ((gint (GtkWidget *widget)){gtk_widget_hide (widget);return TRUE;}),
		    NULL);

probably not
no shortcut for this one :(





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]