How to set caret size?

here an image to explain for my question:

the first one is initial state, as you look, the size is not correct...

but it will be auto resized after you typing some text - second one.

and even you remove all text, the caret is still correct.


so my question is, how to set the initial size of the caret for the texteditor?

thank you.


Take a look at void CaretComponent::setCaretPosition(const Rectangle< int > & characterArea)


but the TextEditor class does not have a method to get the caret component...

The caret size will be based on the font, so maybe call applyFontToAllText when you first create the editor?

i replace my .setFont(26.0f) to .applyFontToAllText(26.0f) and now it works.

but i think .setFont should do this? and .applyFontToAllText is just unnecessary?

ahhhh. sorry my falt.   i just thought that TextEditor is not only a sinlge line text editor..

it probably have huge of text, and applyFontToAllText does a very slow performance...


many thanks jules.