How to write to a textctrl?

Can someone indicate how to write text out to a multi-line textctrl. I'm new to python, and still having trouble trying to get the hand of widgets and their methods. I have created a textctrl below and would like help with trying to write to it:

response = wxTextCtrl(panelB,ID_LOG, "", wxPoint(315,260), wxSize(350,100),
                   wxTE_MULTILINE | wxTE_READONLY)
response.SetInsertionPoint(200)

There is very little information and examples to help with this. Many thanks in advance!

Jim

···

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger

jim bob wrote:

Can someone indicate how to write text out to a multi-line textctrl. I'm new to python, and still having trouble trying to get the hand of widgets and their methods. I have created a textctrl below and would like help with trying to write to it:

response = wxTextCtrl(panelB,ID_LOG, "", wxPoint(315,260), wxSize(350,100),
                  wxTE_MULTILINE | wxTE_READONLY)
response.SetInsertionPoint(200)

There is very little information and examples to help with this. Many thanks in advance!

Jim

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

.

Well,
this is my forst chance to help someone. I've leared with texctrl frew days ahead :wink:
I use SetValue and AppendValue e.g. like this:

        pr = p.printJob()
        l = p.indexGravit()
        hl = p.indexExclus()
        v = p.indexVar()
        self.control.SetValue(pr)
        self.control.AppendText("\nIndex of gravity = " + `l` + "\n")
        self.control.AppendText("Index of exclusivity = " + `hl` + "\n")
        self.control.AppendText("Variability = " + `v` + "\n")

I open my files like this:

def OnOpen(self,e):
        dlg=wxFileDialog(self,"Choose a file",".","","*.*",wxOPEN)
        if dlg.ShowModal() == wxID_OK:
            self.fileName=dlg.GetPath()
            f=codecs.open(self.fileName,'r','utf-8')
            self.control.SetValue(f.read())
            f.close
        dlg.Destroy

where self.control = wxTextCtrl....
Perhaps this would do for you as well as it does for me.

Jim,

response.SetValue("This is first line.\nThis is second line.")

Derrick

jim bob wrote:

···

Can someone indicate how to write text out to a multi-line textctrl. I'm new to python, and still having trouble trying to get the hand of widgets and their methods. I have created a textctrl below and would like help with trying to write to it:

response = wxTextCtrl(panelB,ID_LOG, "", wxPoint(315,260), wxSize(350,100),
                  wxTE_MULTILINE | wxTE_READONLY)
response.SetInsertionPoint(200)

There is very little information and examples to help with this. Many thanks in advance!

Jim

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org