TextEditorDefs flashSpeedIntervalMs


#1

Hi Jules, would it be possible to get access to set this value? I’m having to hard code it right now to match the standard mac blink rate. (~500ms?) It would be nice to have the option to turn off blinking as well.

Graeme


#2

and I would like a choice of caret width (1 pixel instead of 2) just a reminder!


#3

In fact the best thing would probably be to have the lookandfeel return a cursor component that draws and flashes itself. I’ll see what I can do.


#4

Oh Jules!


#5

Hey Jules, thanks for the CaretComponent class. It seems I have to use a workaround type approach to get it to work though. I don’t believe this would be intentional, but maybe I’m missing something or maybe I’m just off base.

//Create a new text editor (Creates caret from default LookAndFeel)  
TextEditor * tx = new TextEditor();

//Set specific LookAndFeel (too late, caret is already created)
tx->setLookAndFeel(myTextEditorLookAndFeel);

//Zero out the caret by hiding it.
tx->setCaretVisible(false);

//Now zeroed, set to visible again to create from current LookAndFeel (now myTextEditorLookAndFeel)
tx->setCaretVisible(true);

#6

I think the idea is that you override the global look and feel, or the look and feel of the TextEditor’s parent Component?


#7

i suspect jules just needs to tweak the TextEditor’s lookAndFeelChanged() implementation


#8

Ah, maybe I forgot to make it refresh the caret comp when the l+f is changed… I’ll check that.