SetInsertionPoint() does not funzion Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Berico3
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon Sep 17, 2007 5:43 am
Location: Italy

SetInsertionPoint() does not funzion

Post by Berico3 »

Hello everyone,
I'm using the libraries wx2.8 on WindowsXP debian6.0 on linux, in a wxTextCtrl flag MULTYLINE I have to move inside the box and I thought of using SetInsertionPoint ().
Once completed, however, does not give me no errors, but the insertion point of the text does not move, still at the beginning of the first line, thus:

Code: Select all

wxTextCtrl *testo = new  wxTextCtrl(this, TESTO, _T(""),  wxDefaultPosition, wxDefaultSize,wxTE_MULTILINE );
testo -> SetInsertionPoint(100);
testo -> WriteText(_T("Test"));
It is I who is wrong?
Thanks to those who respond
OS: Windows XP Pro & Debiam Linux COMPILER: MingW, Version: wxWidgets 2.8.0, IDE: wx-Devcpp
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: SetInsertionPoint() does not funzion

Post by PB »

I believe that the insertion point can not be greater than the value returned by wxTextCtrl::GetLastPosition(), which in your case is 0 ( testo is empty).
Berico3
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon Sep 17, 2007 5:43 am
Location: Italy

Re: SetInsertionPoint() does not funzion

Post by Berico3 »

thanks PB,
I had already made ​​some tests, but did not work.
After your answer I tried again, obviously I was wrong.
SetInsertionPoint can only move inside the text buffer.
OS: Windows XP Pro & Debiam Linux COMPILER: MingW, Version: wxWidgets 2.8.0, IDE: wx-Devcpp
Post Reply