Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxLogSysError and SetDefaultStyle

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxLogSysError and SetDefaultStyle
#3208
Posted by: Player 2004-01-10 06:17:34
Hi.

Ive a little problem using wxLogSysError. It always returns the same error (6 invalid handle). This seems to come from SetDefaultStyle cause if i disable it in the code the error message is right.

This is the code i use:

// Textctrl
m_log = new wxTextCtrl( this, -1, "",wxPoint(5,260), wxSize(630,100),wxHSCROLL | wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2 );

// put log to textctrl
m_logCtrl= wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));

// function 
m_log->SetDefaultStyle(wxTextAttr(*wxRED));
wxLogSysError("Text");
Any Hints ?

Player
Message2. Re: wxLogSysError and SetDefaultStyle
#3210
Posted by: KaReL 2004-01-10 16:24:23
From the manual:
To use the styles you can either call SetDefaultStyle before inserting the text or call SetStyle later to change the style of the text already in the control (the first solution is much more efficient).

Maybe try SetStyle?

------------------------
Website: www.KaReLs0ft.be
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-12-13  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0