wxLogChain behaves strange

Hello to all,

When using the wxLogChain functionality in the following way:

# ---------------------------------------------------------------------
# Set up a log on the View Log Notebook page
parent.log = wxTextCtrl(splitter2, -1,
                        style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
        
# Set the wxWindows log target to be this textctrl
#wxLog_SetActiveTarget(wxLogTextCtrl(parent.log))

wxLogChain(wxLogTextCtrl(parent.log))
# ---------------------------------------------------------------------

In cae of an error raised the error message is nicely written to the
text control, but no message | error window pops up. After I close the
app then the window - actually the last one if there are more then one -
will stay and must be closed to shut down the app. This happens with
wxLogMessage and wxLogError.

On Sourceforge there is no error raised in relation with wxLogChain

What is wrong with my usage of wxLogChain? According to wxWindows Help
it is ok

I'm using: Windows XP; Python 2.3; wxWindows 2.4.1
(wxPythonWIN32-2.4.1.2u-Py23.exe);

I hope somebody can help me,

Regards & thanks

Günter

Guenter Walser wrote:

Hello to all,

When using the wxLogChain functionality in the following way:

# ---------------------------------------------------------------------
# Set up a log on the View Log Notebook page
parent.log = wxTextCtrl(splitter2, -1,
                        style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
         # Set the wxWindows log target to be this textctrl
#wxLog_SetActiveTarget(wxLogTextCtrl(parent.log))

wxLogChain(wxLogTextCtrl(parent.log))

I think you need to set the chain as the active target:

  chain = wxLogChain(wxLogTextCtrl(parent.log))
  wxLog_SetActiveTarget(chain)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!