[pygtk] gtk.gdk.Atom integer value

Xavier Toth txtoth at gmail.com
Sun Mar 8 07:46:47 WST 2009


On Sat, Mar 7, 2009 at 12:56 PM, Stefan Stuhr <gnomelists at sstuhr.dk> wrote:
> lør, 07 03 2009 kl. 11:06 -0600, skrev Xavier Toth:
>> This doesn't return the same value as the atom interned in another X
>> client. I see there is a gdk_x11_atom_to_xatom function but there
>> doesn't appear to be a python binding for it.
>
> import gtk
> import ctypes
> libgdk = ctypes.CDLL("libgdk-x11-2.0.so")
>
> a = gtk.gdk.atom_intern("PyGTKTest")
> xatom = libgdk.gdk_x11_atom_to_xatom(hash(a))
> print xatom
>
>> Ted
>
> Stefan
>
>

Thanks, but I don't understand why doesn't gtk.gdk.Atom map to an X
atom automatically? Also I think this is related to the problem I
having trying to implement copy/paste in that I'm doing :

dib_atom = gtk.gdk.atom_intern("DIB")
requester = gtk.gdk.window_foreign_new(event.requestor)
requester.property_change(gtk.gdk.atom_intern(event.property),
gtk.gdk.atom_intern("ATOM"), 32, gtk.gdk.PROP_MODE_REPLACE,
[dib_atom])

in response to a selection-request-event for TARGETS but the requester
is getting a BadAtom return from the XGetWindowProperty when it tries
to get the value of the property I changed.

Ted


More information about the pygtk mailing list