[wx-dev] [MSW] regression with font used for styled text in wxTextCtrl(wxTE_RICH2)

Stefan Csomor csomor at advancedconcepts.ch
Thu Mar 6 07:25:42 PST 2008


Hi

>  I'm not totally sure as I don't see anything wrong per se in this change
> 
> http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/include/wx/textctrl.h?r1=48
> 952&r2=49108
> 
> but I suspect that this must be indeed what changed the behaviour of my
> code. Before I start debugging this, could you please explain why was it
> necessary to remove m_font at all? At least with my code this results in a
> lot of fonts being created/destroyed/recreated instead of just created
> once...

this lead to a problem in mac textcontrols as well in so far, as before the
wxTextAttribute 'owned' the font, while it now gets created on the fly,
therefore if no copy is taken the native representation gets destroyed after
the call as well. I've added a local var now that copies the font and that
one is used to provide a native font representation that survives until my
methods ends ...

just my 0.02$

Best,

Stefan







More information about the wx-dev mailing list