John Finlay wrote:
> >
> > In theory, you could check which events a widget receives by default
> with
> > get_events() - note that it is a bitmap and you would have to decode
> > it according to the GTK.py _MASK constants. However, this seems to
> > return 0 for any newly-realized widget. Why?
> >
> >
> get_events() reports the same for me though if I set an event mask
> get_events() reports it. I also notice that windows seem to ignore the
> event masks i.e. they get button press and release events without doing
> a set_events() or add_events().
If you look at the realize() handlers of some widgets, they have some
code like this:
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);
They force certain events to be enabled, which are required for correct
operation of the widget.
James.
--
Email: [EMAIL PROTECTED] | Linux.conf.au 2003 Call for Papers out
WWW: http://www.daa.com.au/~james/ | http://conf.linux.org.au/cfp.html
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/