GdkPixbuf.PixbufDestroyNotify - NotImplementedError - python gtk3

落爺英雄遲暮 提交于 2019-12-24 08:19:51

问题


I am trying to use GdkPixbuf.Pixbuf.new_from_data() as shown in gtk 2.x and I am passing 7 arguments. But it gives me an error that I need to pass 9 arguments.

What I am doing now was working for gtk2.x . So I figured out the other 2 arguments that I need to pass.

http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-creating.html

http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-refcounting.html#GdkPixbufDestroyNotify

One of the arguments is of type GdkPixbuf.PixbufDestroyNotify. I don't know how to do this.

I am trying help(GdkPixbuf.PixbufDestroyNotfiy) in ipython but I am getting an error.

error: NotImplementedError.

self.img_pixbuf = GdkPixbuf.Pixbuf.new_from_data(self.img.tostring(),
                                                GdkPixbuf.Colorspace.RGB,
                                                False,
                                                self.img.depth,
                                                self.img.width,
                                                self.img.height,
                                                self.img.width*self.img.nChannels)

#Here my self.img is cv2.cv.iplimage object (OpenCV iplimage)

I am getting following error:

/home/jay/<ipython console> in <module>()

/usr/lib/python2.7/dist-packages/gi/module.pyc in __getattr__(self, name)
    241                 return registry[key]
    242 
--> 243         return getattr(self._introspection_module, name)
    244 
    245     def __dir__ (self):

/usr/lib/python2.7/dist-packages/gi/module.pyc in __getattr__(self, name)
    189             wrapper = info.get_value()
    190         else:
--> 191             raise NotImplementedError(info)
    192 
    193         self.__dict__[name] = wrapper

NotImplementedError: <gi.CallbackInfo object (PixbufDestroyNotify) at 0x0x8df5b6c>

What could be the problem here ?


回答1:


In PyGObject you shouldn't have to deal with DestroyNotify functions. If there is one exposed in the API, then this is a bug. You should report it to bugzilla.gnome.org.



来源:https://stackoverflow.com/questions/10284465/gdkpixbuf-pixbufdestroynotify-notimplementederror-python-gtk3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!