简体   繁体   English

GdkPixbuf.PixbufDestroyNotify-NotImplementedError-python gtk3

[英]GdkPixbuf.PixbufDestroyNotify - NotImplementedError - python gtk3

I am trying to use GdkPixbuf.Pixbuf.new_from_data() as shown in gtk 2.x and I am passing 7 arguments. 我正在尝试使用gtk 2.x中所示的GdkPixbuf.Pixbuf.new_from_data(),并且正在传递7个参数。 But it gives me an error that I need to pass 9 arguments. 但这给了我一个错误,我需要传递9个参数。

What I am doing now was working for gtk2.x . 我现在正在为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-creating.html

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

One of the arguments is of type GdkPixbuf.PixbufDestroyNotify. 参数之一是GdkPixbuf.PixbufDestroyNotify类型。 I don't know how to do this. 我不知道该怎么做。

I am trying help(GdkPixbuf.PixbufDestroyNotfiy) in ipython but I am getting an error. 我正在ipython中尝试help(GdkPixbuf.PixbufDestroyNotfiy),但出现错误。

error: NotImplementedError. 错误: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 ? 这可能是什么问题?

In PyGObject you shouldn't have to deal with DestroyNotify functions. 在PyGObject中,您不必处理DestroyNotify函数。 If there is one exposed in the API, then this is a bug. 如果API中公开了一个,则这是一个错误。 You should report it to bugzilla.gnome.org . 您应该将其报告给bugzilla.gnome.org

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM