[9427] in The GTK GIMP ToolKit mailing list archive

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

[gtk-list] Re: Detecting window from button

daemon@ATHENA.MIT.EDU (Havoc Pennington)
Mon Oct 19 20:23:43 1998

Date: Mon, 19 Oct 1998 19:19:32 -0500 (CDT)
From: Havoc Pennington <rhpennin@midway.uchicago.edu>
Reply-To: Havoc Pennington <rhpennin@midway.uchicago.edu>
To: Martin Schulze <joey@infodrom.north.de>
cc: gtk-list@redhat.com
In-Reply-To: <19981020014521.M27466@finlandia.infodrom.north.de>
Resent-From: gtk-list@redhat.com


On Tue, 20 Oct 1998, Martin Schulze wrote:
> But can I connect a button to the delete_event handler?  The argument
> list is different:
> 
> gint pipe_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
> 
> void callback_func(GtkWidget* button, GtkWidget* dialog)
> 

I just mean to be sure you handle delete_event in some way, it doesn't
have to be the same callback. You need two handlers. However, one can call
the other. You could have: 

gint delete_event_cb(GtkWidget* widget, GdkEvent* event, gpointer data)
{
 GtkWidget* button = GTK_WIDGET(data);

 gtk_signal_emit_by_name(GTK_OBJECT(button), "clicked");
}

Which results in your button callback being called.

Or you could do it the other way around, where the button emits
delete_event. Or you could have both callbacks call a third function, like
close_dialog(). There are many different ways to organize things.

Havoc



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


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