Basil Shubin wrote:
So what to check next? Is there possible solution for a thing I need?
There are all kinds of places that we probably need to add protective
code to in order for an individual Dabo class to play well under a raw
wx.App object instead of a dabo.dApp object. However, it is a worthy
goal and will make Dabo easier to work with if a dGrid can be dropped
into an existing wx application with minimal hassle. In this case, dGrid
was instantiating a dMenu, which meant we needed to fix some stuff in
dMenu. In turn, dMenu may at some point instantiate a dCheckBox, at
which point if something in dCheckBox relies on self.Application,
something else will fail.
I guess we should do a grep on "self.Application" in dabo.ui.uiwx and
see just how daunting a cleanup task we are looking at.
Thanks for giving Dabo a try... I hope we can get dGrid working for you
the way you want it. It may be a bit rough to get going but the work we
do now will make it smoother for the next person, and increase our
knowledge base.
I'm going to commit my changes to dMenu to both 0.6.5 and 0.7a, as well
as other changes to dMenuItem. So, if you want to update from the
nightly tarball in about 18 hours the needed changes will be there for you.
By the way, you had an error in the column definitions (global name
'string' not found). You don't really need to tell dColumn the data type
anymore, and it uses data type codes we don't really use elsewhere, so
just remove them. Here's my test code, by the way:
import wx
import dabo
dabo.ui.loadUI("wx")
class GridTowns(dabo.ui.dGrid):
def initProperties(self):
self.DataSet = [{'town' : 'Moscow', 'country' : 'Russia'},
{'town' : 'Hollister', 'country' : 'United
States'}]
self.Editable = False
self.Sortable = True
self.Searchable = True
def afterInit(self):
GridTowns.doDefault()
col = dabo.ui.dColumn(self, Name='Town', DataField='town',
Width=200, Caption=u"",
Sortable=True, Searchable=True, Editable=False)
self.addColumn(col)
col = dabo.ui.dColumn(self, Name='Country', DataField='country',
Width=175, Caption=u"",
Sortable=True, Searchable=True, Editable=False)
self.addColumn(col)
self.ShowRowLabels = False
self.SelectionMode = 'Row'
self.MultipleSelection = True
app = wx.App()
frm = wx.Frame(None, -1, "test")
grd = GridTowns(frm)
frm.Show()
app.MainLoop()
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users