Page 1 of 1

Unaccurate GUI events

Posted: Thu Aug 25, 2005 5:10 pm
by _Dum0nde
Hi,

I'm working on a project using GUI elements. I noticed that unconsistently some events are unaccurate (i.e. they don't get fired up some times). It seems to happens only with the listboxes when there is an item change (when I click on a new item in the list).

I have a list box and a static text region. When the selected element of the list box is changed, the text is supposed to change too. Sometimes, what I have to do is, for example, click #2 -> nothing happens, click #1, click #2 -> expected text appears. Sometimes, I have to do this a couple of times... (each time I debug, I have to go through the GUI interface, and the behavior seems really random...)

This is the event method:

Code: Select all

bool EvenementsEtude::OnEvent(SEvent event) {
	s32 id;
	
	switch(event.EventType) {  
	case EET_KEY_INPUT_EVENT:
		...

	case EET_GUI_EVENT: 
		id = event.GUIEvent.Caller->getID();

		switch (event.GUIEvent.EventType) {
		case EGET_BUTTON_CLICKED:
			...

		case EGET_LISTBOX_CHANGED:
			if (id == LBChoixScenarios) {
				...
                                // change the text somewhere : it doesn't happen as expected everytime
                                return true;
			}

			break;

		default:
			break;
		}

	default: 
		break;
	}

	return false;
}
Any idea?

Thanks