On Aug 17, 2010, at 9:08 PM, Bronwyn Woods wrote:
> I do call the update method when I change the dataset.
That should not have any effect on the grid unless you also have
dynamic properties defined for the grid. Since you are setting the DataSet
property directly, you don't need the call.
> On further
> examination, it appears that the bus error only occurs when trying to add
> entries to the DataSet... but after a variable number of adds and deletes.
>
> The code for adding an entry is:
>
> def onAddCrit(self, evt):
> """
> Called when the add button for a selection criteria is clicked.
> Adds the selection criteria to the dataset for the selection grid
> but does not add a where clause for the search.
> """
>
> ...[get values from fields in the form]...
>
> self.selData.append({"sec":sec, "desc": movtxt, "keys":keys,
> "incl":True, "excl":False, "del":False})
> self.selGrid.DataSet = self.selData
> self.selGrid.update()
>
> Does anyone have any idea what might be causing this?
It might be some sort of reference conflict. I notice that you're using
'append()', which means that your selData attribute is a list, not a tuple.
Since lists are mutable, you are probably sharing list references between your
local data and the grid's DataSet.
Try this: add 'import copy' to the top of your script, and then change
the assignment line to:
self.selGrid.DataSet = copy.deepcopy(self.selData)
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]