[Xcb] [xpyb] SendEvent considered unusable

Julien Danjou julien at danjou.info
Fri Feb 5 00:52:15 PST 2010


At 1265341650 time_t, Eamon Walsh wrote:
> In the meantime, since the actual events that are typically sent through
> SendEvent are limited to ClientMessage and a few others, you could  turn
> the "pack" code above into a utility function ("create_client_event"). 
> I will update the xpyb documentation to make a note of this and include
> a sample helper function.

> This issue is documented, but a helper function that unpacks the reply
> value into an array of the appropriate cardinal size would be useful
> here.  I'll add one to the docs.

Sounds like a good idea.
IMHO, including a module xcb.util or something like that we some helper
functions may be a nice idea.

> xpyb is a thin wrapper and, unlike C, Python doesn't have the luxury of
> being able to use the wire representation directly as program data and
> vice versa.  So pack/unpack stuff like this is unfortunately going to be
> necessary in a few cases.

I understand.

> There is a project out there called the Python X Library
> (http://python-xlib.sourceforge.net/) that provides a more
> object-oriented interface to the X protocol (windows are objects, for
> example, and window-related protocol requests are methods on the
> object)  I have been meaning to look at the potential for porting it on
> top of xpyb.  It would allow a lot of xpyb's raw corners such as
> SendEvent and GetProperty to be hidden.  However it may also hide some
> of the flexibility of XCB, being more of an Xlib style interface. 
> Haven't looked at it closely.

I did not know about that binding. The idea seems quite interesting
since it looks a bit like what I'm working on these days. (Except that
I'm not targetting the whole protocol and a more a particular use case.)

But clearly, xpyb is not enough to allow you to enjoy Python and XCB.
I hope I will be able to brind some good idea in the future.

Thanks Eamon,

Cheers,
-- 
Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info
// Tomorrow I was nothing, yesterday I'll be.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20100205/c50a63ef/attachment.pgp 


More information about the Xcb mailing list