Passing gtk widget address to gdk_window_set_user_data



Hi,

Trying to implement a custom GtkContainer using gobject introspection.

I need to call gdk_window_set_user_data() for the exact reason
described in the documentation:

http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-window-set-user-data

I'm doing this:

        self.window = Gdk.Window(self.get_parent_window(), attr, 0)
        self.window.set_user_data(self)

where "self" is an instance of a class deriving from Gtk.Container

However, the address received at the C level by
gdk_window_set_user_data() does not correspond to a GtkWidget. This
causes GTK+ to segfault later on. Presumably the address passed
corresponds to a pygobject-level encapsulation of the GtkWidget.

How can I get the "gtk address" of self to pass to this function?

Is this a bug in the bindings? (In PyGTK this "just worked").

Test app: (sorry its a bit messy)
http://dev.laptop.org/~dsd/20110918/container3.py

Thanks,
Daniel


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