This section is under construction! 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 file wconfig.py
in the widget
directory and describe the styles used by this widget
"""\ wxStaticLine widget configuration @copyright: <Add year and your name> @license: <Choice a license> """ config = { 'wxklass': 'myCtrl', 'style_defs': { 'wxMCFance': { 'desc': _('Use the new and fancy design.'), }, 'wxMCOldFashion': { 'desc': _('Use the old fashion design.'), }, }, 'box_label': _('Style'), 'default_style': 'wxMCFance', 'style_list': ['wxMCFance', 'wxMCOldFashion'] }
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 `-- wconfig.py
This section is incomplete.
Load generic and language independent widget configuration
from wconfig.py
(common.load_config()
)
Load and initialise language code writers
(common.load_code_writers()
)
Load and initialise widgets
(common.load_widgets()
)
Load and initialise sizers
(common.load_sizers()
)