foxmulder900
21-11-2007 21:03:33
I am trying to set up a listbox in CEGUI using python-ogre, The box itself will display fine if I comment out the last 6 lines of this code - as soon as I start adding items to the box my application crashes when it tries to render the first frame, I set each items AutoDelete to false and added them to an array so they are not removed by python but it still crashes on me. Any help is appreciated!
def initGUI(app):
## setup GUI system
app.GUIRenderer = CEGUI.OgreCEGUIRenderer(app.renderWindow, ogre.RENDER_QUEUE_OVERLAY, False, 3000, app.sceneManager)
app.GUIsystem = CEGUI.System(app.GUIRenderer)
logger = CEGUI.Logger.getSingleton()
level = CEGUI.Informative
logger.setLoggingLevel(level)
## load scheme and set up defaults
CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLookSkin.scheme")
app.GUIsystem.setDefaultMouseCursor("TaharezLook", "MouseArrow")
app.GUIsystem.setDefaultFont( "BlueHighway-12")
sheet = CEGUI.WindowManager.getSingleton().loadWindowLayout("meshSelectionBox.xml")
app.GUIsystem.setGUISheet(sheet)
meshSelectionBox = CEGUI.WindowManager.getSingleton().getWindow("Root/")
meshList = os.listdir("../resources/models")
i = 0
for mesh in meshList:
item = CEGUI.ListboxTextItem(mesh, i)
item.AutoDeleted = False
meshSelectionBox.addItem(item)
app.ListItems.append(item)
i+=1