Menu

#167 Python Subclassing for Controls not in the wx-Module (e.g. DataViewTreeCtrl)

v1.0_(example)
open
nobody
4
2015-10-11
2015-10-11
MoX
No

It is currently impossible to subclass all Controls that are not in the default wx-Module, for example DataViewTreeCtrl, that is located in wx.dataview.

The XML-File for the Code-generation uses the fully qualified name for construction insted of the placeholder #class.

<template name="construction">
self.$name = wx.dataview.DataViewTreeCtrl( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} )
</template>

So no subclass name can be generated. On the other hand just setting it to #class will break non subclassed usage of these controls (because the name would be "wx.DataViewTreeCtrl".

For everyone that is looking for a workaround without changing the code (just the xml files):
<template name="include">
import wx.dataview;
wx.DataViewTreeCtrl = wx.dataview.DataViewTreeCtrl
</template>
<template name="construction">
self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} )
</template>

Discussion

MongoDB Logo MongoDB