Hi, it's been a while since my last post in this forum section. I've been talking with a couple of team mates from work, and we came up with an idea for a game. Since I'm the only one of them who knows a little bit of code, I'm tasked with programming it (their 3D and concept artists). Anyway, I needed a way to make a GUI without having to write one myself (don't have enough free time), so I scanned the forum for resources and found PGUI by PaTTe. I kinda liked it so I tried to use. Everything went great until I tried to use the ListBox elements, especially when it came to adding items to rows, and rows to the List. Anyway, I have the following peaces of code:
struct pItem {
PListItem* iObj;
};
struct pRow {
PListRow* rObj;
};
which I initialise within my main class:
pItem* pItems;
pRow* pRows;
in order to use them like:
void CREATE_UI()
{
gui = new PGui();
wnd = gui->createWindow(0, "Menu_Window", "Menu", 0, 0, 1024, 50);
gui->createButton("ImportButton", "Import", 0, 20, wnd);
gui->createButton("Save", "Save", 80, 20, wnd);
gui->createListBox("FldCnt",1,55,wnd);
pItems = new pItem[6];
pRows = new pRow[6];
pItems[0].iObj = new PListItem;
pItems[0].iObj->setStringValue("a");
pRows[0].rObj = new PListRow(1);
pRows[0].rObj->addItem(pItems[0].iObj,1);
wnd->getListBox("FldCnt")->addRow(pRows[0].rObj);
}
Everything compiles just thine, but the game crashes, outputing the following error: "STD:
ut_of_range at memory #MemoryAddressGoesHere". I have no idea where the problem is, hence I'm turning to you guys. Any tips or hints?