TextEditor how to resign focus after user hits return

Hi guys,


A quick (and maybe easy) question which stucked me for an hour......

I have a texteditor, and I have override the listener's textEditorReturnKeyPressed (TextEditor &te) method to make response.

I want to make the editor back to its normal appearance (i.e. resign the focus and get rid of the thicker border). However, I did not figure out a way to do this.

I found there is a static function in the online doc, will this be useful in my scenario?


I guess this static funtion is recently added to JUCE? Since I am using 2.0.40 and my juce does not recognize this func.

Any tips?



Just tried the newest unfocusAllComponents() but seems it is not for my usage for this condition..

The texteditor still has the focus after the unfocus was called.


unfocusAllComponents will definitely get rid of the focus, so most likely you've got some other event that's putting it back afterwards?

you are right jules. Tried another time and now works...