events from signals
- From: Ben Dougherty <benjamind miles33 co uk>
- To: gtk-app-devel-list gnome org
- Subject: events from signals
- Date: Thu, 22 Feb 2001 17:33:16 +0000
Hi all,
I expect this is a silly question and I have missed something, but I
carn't figure out how to get an event once in an emission function.
Here is the emission funtion:
gboolean sd_gtk_container_mouse_press_hook(GtkObject *object,
guint signal_id,
guint n_params,
GtkArg *params,
gpointer data)
{
GdkEvent *event=gdk_event_get();
if (!event)
{
err_m("event = NULL");
return(FALSE);
}
err_m("have button event type = %d",event->type);
sd_gtk_notify_container_event(GTK_WIDGET(object), event, data);
/* return TRUE if you want the emission hook to be destroyed */
return(FALSE);
}
this is the call:
gtk_signal_add_emission_hook (gtk_signal_lookup("button-press-event",
GTK_TYPE_WIDGET),
sd_gtk_container_mouse_press_hook,
NULL);
As you can see I tryed to get the event by calling gdk_event_get this
does'nt seem to work. Is it possible to get the event at this stage?
The reason I want to do this is to pick up mouse press events within
a container so if they happened over a button I can still act on them
as the button default handle eats them otherwise and stops propagation.
Thanks for any help,
Ben.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]