[prev in list] [next in list] [prev in thread] [next in thread]
List: php-gtk-dev
Subject: [PHP-GTK-DEV] RE: [PHP-GTK] Which events does a widget listen for
From: Steph <steph () zend ! com>
Date: 2004-06-11 20:25:18
Message-ID: NGBBLHCLELOKOAFANNABMECKEDAA.steph () zend ! com
[Download RAW message or body]
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
>
--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic