Re: Key focus and widgets without GdkWindow
- From: Paul Davis <paul linuxaudiosystems com>
- To: Dag Helstad <dag helstad kreatel se>
- Cc: gtk-list gnome org
- Subject: Re: Key focus and widgets without GdkWindow
- Date: Thu, 21 Nov 2002 09:29:35 -0500
>I guess this is a very basic question, bit I still don't get it :/
>I've understood that only widgets with a GdkWindow of their own can grab
>focus. What is the reason for this? Or have I completely misunderstood
>When I look in the code, it seems Gdk passes all key press events to a
>GtkWindow widget, which in turn dispatches that event to its' focus widget.
>I don't see the connection with GdkWindows here.
>I'm about to write a widget which really doesn't need a window of its own,
>but it needs to be able to grab focus.
the underlying window system (for example X Window) notifies GDK of
key events that occur within "native" windows (i.e. those known to the
native window system). These native windows correspond to
GdkWindows. When a key event gets delivered to GDK, it passes it along
to the relevant widget in GTK, which is generally (but not always) a
GtkWindow. The GtkWindow then has to decide which child widget the key
event should be delivered to, which is generally decided using GTK's
] [Thread Prev