Re: Scribble Example




On Jul 13, 2008, at 9:08 AM, zentara wrote:

Hi, this is the result of my experiments. I can write to the gdk foreign window,
and even move it, but I can't scribble to it with the mouse.
The problem seems to be you can't assign events to the gdk window from
another window, so the mouse is useless on it.

Is there a trick I'm missing? There are 2 attachments. One is the target
script called Z, and the other launches it, starts itself, then tries
to manipulate the gdk window.


(My line numbers are different, i had to hack up something to replace the Wnck code on my system.)

GLib-GObject-WARNING **: gsignal.c:1657: signal `event' is invalid for instance `0x8889b68' at ./screenshot-foreign-write-scribble line 49.


GdkWindow is a GObject but has no signals. You're thinking of the GtkWidget::event signal. If you want integration with the event system, you'll have to wrap the GdkWindow up in a GtkWidget, and enable an event filter. (Oops, gdk_window_add_filter() has never been implemented in the bindings...)


I'm a bit confused, what's the actual goal, here? If you just want to capture the contents of the other window, it seems that readonly access you get here is fine. If you want something more elaborate, then xswallow or GtkPlug/GtkSocket may be more appropriate.


--
Me:  What's that in your mouth?
Zella:  *swallows laboriously*  Nothing.
Me:  What did you just swallow?
Zella:  A booger.
Me:  Baby girl, don't eat boogers.  That's gross.
Zella:  But it was in my nose.




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