On 01-Jul-2000 James Henstridge wrote:
>> > On Tue, 20 Jun 2000, Bellamy Bruno wrote:
>> >> I'm trying to catch the key_release event in a GtkText
>> >
>> > The widget will only receive key press events if it has focus. That could
>> > be what the problem you are seeing. Does the problem go away if you call
>> > text_widget.grab_focus() ?
>>
> I didn't have any trouble with your example when I removed the set_events
> call. Set_events sets the mask for all events that you are interested
> in. I am sure you were not just interested in key releases. The
> add_events variant is usually the one you want.
Right. The set_events doesn't make change, so I removed it.
I realized that it doesn't need a mouse click in the window, but it
needs that the mouse is somewhere over the window to actually have the focus.
I guess I don't know X-Window well enough. It looks strange to me, because even
if this window doesn't have the focus this way (i.e. the mouse is over this
window) I can already type text in it, so I thought it actually got the focus
(and I used the grab_focus so it got it... Maybe I shouldn't?).
If the mouse is outside, then the key_release event is not working (unless I
clicked in the window). I wonder if there's a way to catch this event even if
the mouse is outside.
Or does it have something to do with the focus settings in the window-manager
setup? I tried several ways, without any change in my test program behaviour...
----------------------------------
E-Mail: Bellamy Bruno <[EMAIL PROTECTED]>
Date: 01-Jul-2000
Time: 21:31:25
This message was sent by XFMail
----------------------------------
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk