wx.TextCtrl

Hello!

I'm currently working on project that requires a console like
operation, where input comes from one wxTextCtrl area and a
wx.TE_READONLY formatted wx.TextCtrl is used for output. Trouble is I
need to remove any possible user intervention in the output TextCtrl
itself, because if I click anywhere in the output area the next output
from wxWriteText will simply dump itself where the cursor was placed.
Is it perhaps that I am using the incorrect class for this type of
operation, or is there a workaround? I mean I don't mind having the
ability to highlight the console text for copy/paste purposes, but the
cursor changing the insertion point is doing my head in.

Thanks in advance for any advice.

Alexander.

Hi,

ยทยทยท

On Mon, Nov 16, 2009 at 8:23 AM, alexander <blipphunk@googlemail.com> wrote:

Hello!

I'm currently working on project that requires a console like
operation, where input comes from one wxTextCtrl area and a
wx.TE_READONLY formatted wx.TextCtrl is used for output. Trouble is I
need to remove any possible user intervention in the output TextCtrl
itself, because if I click anywhere in the output area the next output
from wxWriteText will simply dump itself where the cursor was placed.
Is it perhaps that I am using the incorrect class for this type of
operation, or is there a workaround? I mean I don't mind having the
ability to highlight the console text for copy/paste purposes, but the
cursor changing the insertion point is doing my head in.

Thanks in advance for any advice.

Either call txtctrl.SetInsertionPoint(txtctrl.GetLastPosition())
before writing the text to the control to ensure that the insertion
point is still at the end. Or use the AppendText method which should
add the text to the end.

Cody