2024-10-04 11:26:09 发布
网友
我在网上找不到任何关于如何使用这种方法的例子。我想这可能是我会用到的东西。有人能给我举一个如何使用这个方法的例子吗?在
http://wxpython.org/docs/api/wx.xrc.XmlResource-class.html
基于源代码,我相信这就是你应该做的。在
源代码: http://wxwidgets2.8.sourcearchive.com/documentation/2.8.7.1/classxrc_1_1XmlResource_4a0466d7ef7ac98ef7a9b8135a0c9339.html
def AddSubclassFactory(*args, **kwargs): """AddSubclassFactory(XmlSubclassFactory factory)""" return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs)
因此,您可以看到它正在查找XmlSubclassFactory类型的对象。从文档中(http://wxpython.org/docs/api/wx.xrc.XmlSubclassFactory-class.html)我们发现。。。在
我们可以看到XmlSubClassFactory的构造函数没有参数。因此,我们创建了一个XmlSubclassFactory对象,并创建了一个将子类工厂添加到其中的资源。在
import wx from wx import xrc scf = xrc.XmlSubClassFactory() resource = xrc.XmlResource("resource.xrc") resource.AddSubclassFactory(scf)
不幸的是,我找不到Python示例。但是,我认为Perl模拟非常接近。从http://permalink.gmane.org/gmane.comp.lang.perl.wxperl/477
Wx::XmlResource::AddSubclassFactory( MyFactory->new ); // perl
这和我们正在做的很相似。我相信代码片段和源代码之间是一个很好的开始。祝你好运!在
基于源代码,我相信这就是你应该做的。在
源代码: http://wxwidgets2.8.sourcearchive.com/documentation/2.8.7.1/classxrc_1_1XmlResource_4a0466d7ef7ac98ef7a9b8135a0c9339.html
因此,您可以看到它正在查找XmlSubclassFactory类型的对象。从文档中(http://wxpython.org/docs/api/wx.xrc.XmlSubclassFactory-class.html)我们发现。。。在
^{pr2}$我们可以看到XmlSubClassFactory的构造函数没有参数。因此,我们创建了一个XmlSubclassFactory对象,并创建了一个将子类工厂添加到其中的资源。在
不幸的是,我找不到Python示例。但是,我认为Perl模拟非常接近。从http://permalink.gmane.org/gmane.comp.lang.perl.wxperl/477
这和我们正在做的很相似。我相信代码片段和源代码之间是一个很好的开始。祝你好运!在
相关问题 更多 >
编程相关推荐