Hi, friends!

Currently I trying to add an dGrid into the XRC frame via AttachUnknownControl. I have defined dGrid subclass like this:

class GridTowns(dGrid):

    def initProperties(self):
        self.DataSet = [{'town' : 'Moscow', 'country' : 'Russia'}]

        self.Editable = False
        self.Sortable = True
        self.Searchable = True

    def afterInit(self):
        GridTowns.doDefault()

        col = dColumn(self, Name='Town', DataField='town',
                      DataType=string, Width=200, Caption=u"",
                      Sortable=True, Searchable=True, Editable=False)
        self.addColumn(col)

        col = dColumn(self, Name='Country', DataField='country',
                      DataType=string, Width=175, Caption=u"",
                      Sortable=True, Searchable=True, Editable=False)
        self.addColumn(col)

        self.ShowRowLabels = False
        self.SelectionMode = 'Row'
        self.MultipleSelection = True

And then embed it into the frame's panel in some other place in the code:

self.gridTowns = GridTowns(self.panel)
self.resource.AttachUnknownControl('gridTowns', self.gridTowns,
                                   self.panel)

Alas, I have got an error thet I dont understand:

Traceback (most recent call last):
  File "./wxExpress", line 9, in ?
    main()
  File "/home/bashu/work/devel/wxExpress/gui/main.py", line 30, in main
    app = MainApp(0)
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7700, in __init__
    self._BootstrapApp()
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7352, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/home/bashu/work/devel/wxExpress/gui/main.py", line 14, in OnInit
    frame = MainFrame()
File "/home/bashu/work/devel/wxExpress/gui/mainframe.py", line 17, in __init__ self.InitNotebook() File "/home/bashu/work/devel/wxExpress/gui/mainframe.py", line 29, in InitNotebook
    self.tabTown = TownsRefPanel(self.frame, self.resource)
File "/home/bashu/work/devel/wxExpress/gui/townsref.py", line 18, in __init__
    self.InitGrid()
File "/home/bashu/work/devel/wxExpress/gui/townsref.py", line 32, in InitGrid
    self.gridTowns = GridTowns(self.panel)
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dGrid.py", line 1451, in __init__ cm.dControlMixin.__init__(self, preClass, parent, properties, *args, **kwargs) File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dPemMixin.py", line 165, in __init__
    self.setProperties(properties)
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/lib/propertyHelperMixin.py", line 179, in setProperties
    _setProps(propDict)
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/lib/propertyHelperMixin.py", line 171, in _setProps
    setter(self, _propDict[prop])
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dGrid.py", line 3205, in _setDataSet
    self.fillGrid(True)
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dGrid.py", line 1703, in fillGrid
    dabo.ui.callAfter(self._restoreSort)
AttributeError: 'module' object has no attribute 'callAfter'

Please, I need yours explanations and help!

Thank you!

--
Basil Shubin
Freelance Software Developer


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to