Christian Reis wrote:

>On Wed, May 15, 2002 at 09:37:06AM -0700, 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().
>>    
>>
>
>Thanks for the list (added question 3.5). Well, get_events() reports 0
>when the widget has just been realized, and after we fiddle using
>set/add_events, it returns the bitmask used in that calls, so it's
>pretty useless to me.
>
>GtkWindow has some default masks selected (saw my gtkwindow.c example in
>the other message) which is why it gets them automatically. Why
>GtkEventBox doesn't get key_press_events, even with a proper mask,
>however, is a mystery - GtkWindow seems to eat them up!
>  
>
Key press events are handled specially in the GTK event queue.  When it 
sees key events targetted at any subwindow within the toplevel, they are 
redirected to the toplevel GtkWindow.

The key_press_event handler for the toplevel window checks to see if the 
key event corresponds to an accelerator/mnemonic (and activates the 
appropriate widget if so), or passes the key event on to the widget with 
focus (even if the widget is a NOWINDOW widget, IIRC).

I learned about all this handling when trying to get an app that was 
using mozilla and native widgets together to play nicely with the focus ...

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/

Reply via email to