Re: Random questions...




Matthew Berg <wdomburg@pce.net> writes:

> Question about GdkEventKeys -
> 
> When setting up a callback for for a key_press_event, how do I check for key
> combinations, e.g. CTRL-W?

if (event->state & GDK_CONTROL_MASK)
 
> >From what little I've done with capturing gdk events, it seems that key events
> are captured propogated from parent to child.  If I set up a handler on the
> window, is there any way to prevent it being captured by child callbacks as
> well?

Actually, they are propagated from child to parent. So there is
effectively no way to prevent them being seen by the child. 
(Except by calling gtk_signal_handler_block() for each child
individually)
 
> (I seem to remember that setting the return on the handler to TRUE was
> supposed to indicate that it was already taken care of, but that didn't seem
> to work, or maybe I'm misinterpreting what I read?)

What returning TRUE means is that the event shouldn't be propagated
to the widget's parent. But other handlers for the current widget
will still be run. You want to call gtk_signal_emit_stop_by_name()
in addition to returning TRUE.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]