What's the future of wxT() and _T()?

Vadim Zeitlin vadim at wxwidgets.org
Sat Dec 1 06:08:51 PST 2007


On Sat, 01 Dec 2007 12:15:34 +0000 Julian Smart <julian at anthemion.co.uk> wrote:

JS> I think I'd go for (0) - I don't like the idea of wxT() strings not 
JS> being passable to wxChar* arguments; that could break quite a lot of code.

 I don't know how common such functions are in the user code (as Vaclav
mentioned, there are none in wx itself now) nor how common is it to pass
literal strings to them. And I suspect that they may need to be changed to
use wxString anyhow because even if people pass _T("foo") to them now they
will naturally want to use just "bar" in wx3 where _T() won't be used much.
But well, maybe it's better to be cautious.

 However this leaves us with the question of unneeded conversions in the
code. I don't volunteer to review all the existing code right now but it
would still be great to have a rule for writing the new code -- what should
you do with literal strings? Of course, in many cases it probably doesn't
matter but OTOH why add gratuitous inefficiencies to the code? So if we
can't reuse wxT() for this we'll need to use wxSTRING_TEXT but it is
really, really long so maybe we could rename it to wxTEXT? OTOH wxTEXT
could be confusing to Win32 people because it won't be the same as _TEXT
(which is the same as _T which will remain to be the same as wxT).

 So maybe we could use wxSTR() or even wxS()?

 Thanks,
VZ





More information about the wx-dev mailing list