Unaccurate GUI events

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
_Dum0nde
Posts: 24
Joined: Thu Mar 17, 2005 3:26 pm

Unaccurate GUI events

Post 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
Post Reply