Re[2]: [PHP-GTK] Which events does a widget listen for

From: Date: Sat, 12 Jun 2004 04:26:34 +0000
Subject: Re[2]: [PHP-GTK] Which events does a widget listen for
References: 1 2  Groups: php.gtk.dev php.gtk.general 
Request: Send a blank email to php-gtk-dev+get-630@lists.php.net to get a copy of this message
Hi, Saturday, June 12, 2004, 6:25:18 AM, you wrote: S> Scott, congratulations! I think you found a PHP-GTK bug. S> attributes.event_mask = gtk_widget_get_events (widget); S> attributes.event_mask |= (GDK_EXPOSURE_MASK | S> GDK_BUTTON_PRESS_MASK | S> GDK_BUTTON_RELEASE_MASK | S> GDK_BUTTON1_MOTION_MASK | S> GDK_BUTTON3_MOTION_MASK | S> GDK_POINTER_MOTION_HINT_MASK | S> GDK_POINTER_MOTION_MASK | S> GDK_ENTER_NOTIFY_MASK | S> GDK_LEAVE_NOTIFY_MASK); S> (from gtkentry.c, around line 1000 in my - admittedly GTK 2 - copy) S> - that's where the event_masks for the widgets are originally set. So S> there's your list for GtkEntry, at least.. S> The notes for gtk_widget_get_events itself say: S> * gtk_widget_get_events: S> * @widget: a #GtkWidget S> * S> * Returns the event mask for the widget (a bitfield containing flags S> * from the #GdkEventMask enumeration). These are the events that the widget S> * will receive. S> All I get here from var_dump($widget->get_events()); is int[0]. S> You can either trawl through GTK src looking for attributes.event_mask, or S> you could steal the bit of PHP-GTK code from the signals/events chapter in S> the manual and play with the widgets to see what you get. I don't know if S> there's any point in putting in a bug report at this stage, everyone's busy S> with PHP 5 development and will then be straight onto PHP-GTK 2.. but S> copying this to the dev list anyway so everyone knows it's there. S> Sorry, S> - Steph It seems get_events() only returns what has been set previously by set_events() or add_events() so it would seem safe to set whatever events you want after creating the widget and then modify them later if needed. Can't find any way to get what the eventmask is set to by the widget itself (unless of course it is 0 :) -- regards, Tom

« previous php.gtk.dev (#630) next »