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

From: Date: Fri, 11 Jun 2004 20:25:18 +0000
Subject: RE: [PHP-GTK] Which events does a widget listen for
References: 1  Groups: php.gtk.dev php.gtk.general 
Request: Send a blank email to php-gtk-dev+get-629@lists.php.net to get a copy of this message
Scott, congratulations! I think you found a PHP-GTK bug. attributes.event_mask = gtk_widget_get_events (widget); attributes.event_mask |= (GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); (from gtkentry.c, around line 1000 in my - admittedly GTK 2 - copy) - that's where the event_masks for the widgets are originally set. So there's your list for GtkEntry, at least.. The notes for gtk_widget_get_events itself say: * gtk_widget_get_events: * @widget: a #GtkWidget * * Returns the event mask for the widget (a bitfield containing flags * from the #GdkEventMask enumeration). These are the events that the widget * will receive. All I get here from var_dump($widget->get_events()); is int[0]. You can either trawl through GTK src looking for attributes.event_mask, or you could steal the bit of PHP-GTK code from the signals/events chapter in the manual and play with the widgets to see what you get. I don't know if there's any point in putting in a bug report at this stage, everyone's busy with PHP 5 development and will then be straight onto PHP-GTK 2.. but copying this to the dev list anyway so everyone knows it's there. Sorry, - Steph > -----Original Message----- > From: Scott Mattocks [mailto:crisscott@netzero.com] > Sent: 11 June 2004 20:21 > To: php-gtk-general@lists.php.net > Subject: Re: [PHP-GTK] Which events does a widget listen for > > > Scott Mattocks wrote: > > > > > if (GDK_BUTTON_PRESS_MASK | $widget->get_events()) { > > echo 'Button press event accepted.'; > > } > > > > Sorry make that a bitwise and not an or > > if (GDK_BUTTON_PRESS_MASK & $widget->get_events()) { > ... > > Scott Mattocks > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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