wxTreeCtrl - SetFocus to TextCtrl

BlitzMax Modules Forums/Brucey's Modules/wxTreeCtrl - SetFocus to TextCtrl

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Is something wrong with setfocus to a textctrl?

On treectrl; OnInit:
connectany(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, Clicked) 



Function Clicked(_Event:wxEvent) 
	Local Tree:wxTreeCtrl = MyTree(_event.parent) 
	Local Obj:TPresetItem = TPresetItem(tree.GetItemData(Tree.GetSelection())) 
	If Obj Then
		txtFunctionCode.WriteText(Obj.Conversion) 
		Local F:Int, T:Int
		txtFunctionCode.GetSelection(F, T) 
		txtFunctionCode.SetSelection(f - (obj.Selection + 1), (f - (obj.Selection + 1)) + Obj.selection) 
		txtFunctionCode.SetFocus() 
	End If
End Function


It is writing the text, setting the selection, but not getting any keyboard focus. The focus remains on the Tree control, rather then switching to txtFunctionCode (TextCtrl).

Am I missing something or is this a bug?