So... I have a list box.. I know how to add items to it but I don't know how to implement it in the EventReceiver.
I did something like:
case EGET_LISTBOX_CHANGED:
and checked if there is the correct id... but nothing happends.
Morehover I tryed to debug it... and when I press a button it gets in the case... if I select something form the listbox it doesn't.
Could someone write a very simple example (just the code to be pun in the EvenReceiver).
Also I'd like to get the number of the item that was selected(as in 0 to number of items-1)
ListBox using problem
This is what I do, but I am kind of a noob here:
Public:
game loop:
Code: Select all
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
if (event.GUIEvent.EventType ==EGET_LISTBOX_CHANGED)
{
listChanged = true;
}
Code: Select all
bool getListChanged(){if(listChanged){listChanged = false;return true;}else return false;}
Code: Select all
if(rv.getListChanged())
{
signed int n = list->getSelected();
switch(n)
{
case -1:str = "";break;
case 0: str = "";break;
case 1: str = "";break;
}