How to use wxLogWindow?
How to use wxLogWindow?
I make it but unable close it by calling the delete method inside wxApp::OnExit() or wxFrame::OnClose();. What is the suitable way to use wxLogWindow? Or where are an example about it? Thank you.
As far as I know, wxLogWindow should not be shown directly, but instead you should use:
wxLogMessage, wxLogError, wxLogWarning shows the wxLogWindow when something needs to be displayed.
You can define a wxLogNull object on the stack to supress the log errors.
A pretty solid and good mechanism, it also shows the time and you can export the errors.
- Jorgen
wxLogMessage, wxLogError, wxLogWarning shows the wxLogWindow when something needs to be displayed.
You can define a wxLogNull object on the stack to supress the log errors.
A pretty solid and good mechanism, it also shows the time and you can export the errors.
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
I have problems to understand what your problem is. If the log window is a child of your frame, it will be closed if your frame will be closed, whithout any work for you.make it but unable close it by calling the delete method inside wxApp::OnExit() or wxFrame::OnClose();.
@Jorg
Is this really true? I think you need to explicitly Show() the log window. If a user closes it it stays closed. For that reason if have derived my own log window, which shows itself every time a message appears.wxLogMessage, wxLogError, wxLogWarning shows the wxLogWindow when something needs to be displayed.
regards,
gunnar
Get the music out of wxWidgets, use wxMusik
from http://musik.berlios.de
from http://musik.berlios.de
I never need to show the log error message window explicitly. That is part of the power of logging I assume it is all done for you.
Multiple wxLogError calls will appear in the same window, with timestamps. The last time I used it with wxLexer (class under development) and I would get an error from my class, the log window pops up right away.
This was 2.5.3 I am not sure if anything has changed since this ...
Regards,
- Jorgen
Multiple wxLogError calls will appear in the same window, with timestamps. The last time I used it with wxLexer (class under development) and I would get an error from my class, the log window pops up right away.
This was 2.5.3 I am not sure if anything has changed since this ...
Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
-
- Knows some wx things
- Posts: 39
- Joined: Thu Nov 25, 2004 10:10 am
- Location: Germany
In a Frames constructor I have
Now u can use e.g. wxLogMessage() everywhere in your Application, it s output will be written to the above wxTextCtrl ...
Code: Select all
MyFrame::MyFrame( ...){
...
m_log_textctrl =
new wxTextCtrl (this, -1, wxEmptyString, wxPoint (0, 250),
wxSize (700, 100), wxTE_MULTILINE);
m_logger = new wxLogTextCtrl (m_log_textctrl);
m_logger->SetActiveTarget (m_logger);
...
}
The only thing i would still like, is to embed the wxLogWindow's list view (with time stamp and icons) inside my own app, that would be great.. But other then that, the wxLog mechanism is excellent.
- Jorgen
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb