team23
30-04-2007 08:37:38
Ok, so I'm using a CEGUI MultiColumnList and I'm hitting an issue when adding items to it.
So I'm defining a list box item in a local function scope, then add it to a list. If I don't hold those items in some global/class scope I get a crash. Is this Python cleaning them up while they're still being used by the MultiColumnList?
runtime error R6025
- pure virtual function call
The code in question is below, I'm really confused by this one.
So I'm defining a list box item in a local function scope, then add it to a list. If I don't hold those items in some global/class scope I get a crash. Is this Python cleaning them up while they're still being used by the MultiColumnList?
runtime error R6025
- pure virtual function call
The code in question is below, I'm really confused by this one.
contextList = cegui.WindowManager.getSingleton().getWindow("PySim/Planet/ContextPanel/MultiColumn")
contextList.resetList()
for i in range(0, contextList.columnCount):
contextList.removeColumn(0)
#Add columns to the context panel, then add entries.
colWidth = cegui.UDim(0.25, 0.0)
contextList.addColumn("Item", 0, colWidth)
contextList.addColumn("Price", 1, colWidth)
red = cegui.colour(1.0, 0.0, 0.0, 0.5)
black = cegui.colour(0.0, 0.0, 0.0, 1.0)
itemList = self.planet.items
i = 0
for planetObjIndex, (itemID, cost) in enumerate(itemList):
item = self.gameInfo.items[itemID]
itemCost = cost
itemName = item.name
itemRowID = contextList.addRow()
itemCostListItem = cegui.ListboxTextItem(itemCost.__str__(), planetObjIndex)
itemNameListItem = cegui.ListboxTextItem(itemName, planetObjIndex)
contextList.setItem(itemNameListItem, 0, itemRowID)
contextList.setItem(itemCostListItem, 1, itemRowID)
itemCostListItem.setSelectionColours(red)
itemNameListItem.setSelectionColours(red)
itemCostListItem.setTextColours(black)
itemNameListItem.setTextColours(black)
itemCostListItem.setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush")
itemNameListItem.setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush")