This section is under constraction! Please use this information carefully.
Create a new directory named like the widget and change in this directory
Place an empty file __init__.py in that
directory
Create a Python file codegen.py with initial content like
"""
Code generator functions for myCtrl objects
@copyright: <Add year and your name>
@license: <Choice a license>
"""
import common
class PythonMyCtrlGenerator(wcodegen.PythonWidgetCodeWriter):
tmpl = '%(name)s = %(klass)s(%(parent)s, %(id)s, %(label)s%(style)s)\n'
# end of class PythonMyCtrlGenerator
def initialize():
common.class_names['EditmyCtrl'] = 'myCtrl'
pygen = common.code_writers.get("python")
if pygen:
pygen.add_widget_handler('myCtrl', PythonMyCtrlGenerator())Create a Python file named like the widget directory e.g. myctrl.py
Create remaining code generators
Example of the created structure
myctrl |-- __init__.py |-- codegen.py `-- myctrl.py