[Solved] ComboBox - List "randomly" appears

gkimsey

08-03-2011 18:33:53

Hi,

I'm new to MyGUI and generally having a hard time working with the complex widgets.

I have a combo box which I've made read-only and drop enabled. I got the event callback working after I did that.

In my program, I manually change the selected item in the combo box. Usually this works as I would expect (text changes). However, sometimes it brings up the list while changing the selected item (in code). I can't figure out why it's doing this. I also can't figure out how to make the drop down list go away through code.

To fix this I either need to figure out why it is sometimes bringing up the list when I use setIndexSelected() and stop it, or I need to know how to make the list go away and just do that after the setIndexSelected() call.

Thanks,
Glen

gkimsey

09-03-2011 15:09:59

Update -- I found out why it was appearing. I was doing other UI (non-GUI) operations without realizing the focus was still on the combo box after making a selection. Certain keypresses (up, down arrows, letters of items in the list) would cause the list to appear.

This half way solves my problem. What I need to know now is how to drop focus from a widget in code. Any help?

Thanks,
Glen

Altren

09-03-2011 15:13:11

MyGUI::InputManager::getInstance().resetKeyFocusWidget();

gkimsey

09-03-2011 18:31:04

Thanks!