Hello,
according the the wxLog help the wxLogWindow target will pass the log message to the previous target. I guess thats why besides the message beeing appended on the log the window I get it also on a messagebox.
Any idea how can I change this to just have the log messages on the log window ?
I am using wxLogMessage after setting a wxLogWindow as the active target.
disabling next target from wxLogWindow Topic is solved
-
- Earned some good credits
- Posts: 101
- Joined: Wed Jun 29, 2005 10:13 pm
- Location: Portugal
- Contact:
Thats not possible because wxLogNull is not a wxLogTarget object, I found a workaround:
The only problem I have now is that when the program windows is closed, don't know why but I get the Log Message window at this time.
Code: Select all
wxLog::GetActiveTarget()->Suspend();
wxLog::SetActiveTarget(new wxLogWindow(frm, _("Server log")));
Are you sure about that? From the docs:Lamego wrote:Thats not possible because wxLogNull is not a wxLogTarget object
Code: Select all
static wxLog * SetActiveTarget(wxLog * logtarget)
And what exactly is the problem with closing the main frame?
Chris
this->signature=NULL;
-
- Earned some good credits
- Posts: 101
- Joined: Wed Jun 29, 2005 10:13 pm
- Location: Portugal
- Contact:
more info
I am sure on this:
When the main frame is closed I get the usual log message dialog box (not the wxLogWindow which is used during run-time) as if it reverted to the default log target displaying the queued message.
I guess that when I suspend the log, the messages are kept queued on the original target.
Code: Select all
Protocol.cpp:63: error: no matching function for call to 'wxLog::SetActiveTarget(wxLogNull*)'
/usr/include/wx-2.6/wx/log.h:180: note: candidates are: static wxLog* wxLog::SetActiveTarget(wxLog*)
I guess that when I suspend the log, the messages are kept queued on the original target.
Hi Lamego,
man, I should read the docs more often ;
the ctor of wxLogWindow has a parameter to disable passing through:
HTH, Chris
man, I should read the docs more often ;
the ctor of wxLogWindow has a parameter to disable passing through:
Setting that to false should solve your problem.wxLogWindow(wxFrame *parent, const wxChar *title, bool show = true, bool passToOld = true)
with
passToOld
true to process the log messages normally in addition to logging them in the log frame (default), false to only log them in the log frame.
HTH, Chris
this->signature=NULL;
-
- Earned some good credits
- Posts: 101
- Joined: Wed Jun 29, 2005 10:13 pm
- Location: Portugal
- Contact:
almost there
Also next time I need to check again the constructors on the manual
Anyway now I have a different problem, the log windows works great until I need to Hide() the main frame, at that time the logging starts to happen on default log message box (the logwindow is still visible so I am sure its not beeing destroied).
Any more Ideas ?
Anyway now I have a different problem, the log windows works great until I need to Hide() the main frame, at that time the logging starts to happen on default log message box (the logwindow is still visible so I am sure its not beeing destroied).
Any more Ideas ?