Re: gtk_event_put() and foreign GDK windows



On Wed, 2003-12-17 at 16:24, Dave Menendez wrote:
On Wed, 2003-12-17 at 16:12, Owen Taylor wrote:
On Wed, 2003-12-17 at 16:02, Dave Menendez wrote:

So it seems as if gdk_event_put() when used on a foreign GDK window will
place the event in my local application's gdk event queue but will not
send an actual X event to the foreign X window.  I'm able to get Nedit
to see a key press only by sending an XEvent myself at the Xlib level. 
Is this the intended behavior of gdk_event_put()?

Yes, you have it exactly. (Using Xlib directly is generally the right
thing to do when you are doing something specific to X.)

Thanks, Owen.  At least it sounds like I was following the right path,
then, even though it didn't feel right.  Let me ask a follow-up question
to set my mind straight on the overall intent of GDK.  I was trying to
stay within GDK and away from Xlib-specific calls since I thought that
GDK's purpose was to abstract windowing system calls.  So I assumed that
gdk_put_event would have translated and forwarded the "abstract" GDK
event to the underlying windowing system, whether it was running on
Win32 or X windows.

The point of GDK is to abstract windowing system calls, but that only
makes sense when the concept actually makes sense cross platform...
things like drawing a line or maximizing a window generally 
do make sense.

As I understand it, what you want to do is, given the XID of the
nedit window, you want to send it a KeyPress event. Windows on Win32
don't have XID's, of course, and while there might be a somewhat
similar concept of sending a key-pressed message to a toplevel
window handle, the details are going to be quite different. 

Presumably you got the XID of the nedit window in some X-specific
way. Once you are doing X specific things, there is no particular
virtue in turning around and trying to do everything else through
GDK.

Regards,
                                        Owen





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