I am using WxRuby to build a WinXP desktop application. I’ve just hit a
problem when trying to use set_focus. When a user selects a row in a
ListCtrl, I want to set focus to a particular TextCtrl. So in the
for the ListCtrl’s evt_list_item_selected event, I get hold of the
and send it set_focus.
I can see the TextCtrl get focus only for a split-second (the text
bar briefly appears, then disappears). I suspect that my ListCtrl event
handler is called (and I move focus) before the ListCtrl is completely
finished handling its own event. So right after I move focus to the
TextCtrl, the ListCtrl grabs it back.
Is there a technique for getting it to behave the way I want it to?
tried doing the set_focus in another thread after waiting 2 seconds, but
behavior is exactly the same as when I do the set_focus in the event
Thanks for any advice you can provide.