[pygtk] How to get cursor/mouse-pointer image (pixbuf) for an application window.

Osmo Maatta osmoma at gmail.com
Mon Mar 1 17:05:41 WST 2010


I wasn't aware of the ctypes module at all.
It really works well and I solved this problem by using ctypes to access 
functions in libXfixes.so.

The final code is here:

# Running it on Linux.
# Sleep a while so you have time to position the mouse-pointer/cursor.
$ sleep 5; python read_cursor_image.py

# The cursor image is saved to cursor1.png

Many thanks!

  Osmo Antero M.
  Grønland, Oslo

Wojciech Muła wrote:
> Osmo Maatta <osmoma at gmail.com> wrote:
>> I've done it in c-code earlier and it works well.
>> The c-code is here: 
>> http://code.google.com/p/gscreendump/source/browse/trunk/src/sd_xutils.c
> Standard python module ctypes allows to call any function from
> a shared library. Try to load xlib and call these XFixes-functions.
> w.
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100301/324ebb4a/attachment.htm 

More information about the pygtk mailing list