首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GdkPixbuf.PixbufDestroyNotify - NotImplementedError - python gtk3

GdkPixbuf.PixbufDestroyNotify - NotImplementedError - python gtk3
EN

Stack Overflow用户
提问于 2012-04-23 16:28:45
回答 1查看 439关注 0票数 1

我试图使用GdkPixbuf.Pixbuf.new_from_data(),如GTK2.x所示,并传递7个参数。但是它给了我一个错误,我需要传递9个参数。

我现在所做的是为gtk2.x工作。所以我想出了另外两个我需要通过的论点。

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

其中一个参数是GdkPixbuf.PixbufDestroyNotify类型的。我不知道该怎么做。

我正在尝试ipython中的帮助(GdkPixbuf.PixbufDestroyNotfiy),但是我得到了一个错误。

错误: NotImplementedError.

代码语言:javascript
复制
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)

我收到以下错误:

代码语言:javascript
复制
/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>

这里有什么问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-04-23 21:21:41

在PyGObject中,您不必处理DestroyNotify函数。如果在API中公开了一个,那么这就是一个bug。你应该向bugzilla.gnome.org报告。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10284465

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档