Hi:

I want to redirect stdout to a textctrl I have. From what I read in
the wxpython documentation, I can use the wxLogTextCtrl class to do
this. I am doing the following:

class MyGui(gui.MyFrame):  #gui.MyFrame generated by wxGlade
    def __init__(self, *args, **kwds):
        gui.MyFrame.__init__(self, *args, **kwds)
        # ... code removed ...
        wx.Log_SetActiveTarget(wx.LogTextCtrl(self.text_ctrl_2))
        print 'foo' #to test the redirection

if __name__ == "__main__":
    app = wx.App(redirect=wx.LogTextCtrl)
    wx.InitAllImageHandlers()
    gui = MyGui(None, -1, "")
    app.SetTopWindow(gui)
    gui.Show()
    app.MainLoop()

However, the output instead of going to my textctrl, goes to a new
window named "xwPython: stdout/stderr".

What am I missing?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to