1

I'm using C++. A simple rich text ctrl box with some sentences. I'm using this because I require the scroll. My problem is the blinking cursor at the start of the text (As shown in the image below)

wxwidgets

I searched the internet and found this piece of code:

http://forums.wxwidgets.org/viewtopic.php?p=96307

In the above link I found info for the text ctrl it goes something like this:

textctrl->SetFocus();
textctrl->ShowNativeCaret(false);

But I did not find valuable information for the RichTextCtrl box

Also I tried to set the cursor as a blank cursor but it did not work for me

window->SetCursor(wxCursor(wxCURSOR_WAIT));

Any ideas ?

Thanks in advance

Jurgen Cuschieri
  • 658
  • 14
  • 33

1 Answers1

1

wxTextCtrl::ShowNativeCaret() is implemented only on Windows and simply uses native APIs ShowCaret() and HideCaret().

You can easily replicate this for wxRichTextCtrl by hooking the set focus event:

richTextCtrl->Bind(wxEVT_SET_FOCUS, [richTextCtrl](wxFocusEvent&) {
    HideCaret(richTextCtrl->GetHWND());
});

(Or using member function instead if your compiler does not support C++11 lambdas yet. See "Dynamic Event Handling" chapter here for more information.)

Yirkha
  • 12,737
  • 5
  • 38
  • 53