Error get the name of the page in wxauinotebook

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ozkarleo
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 17, 2015 2:14 am

Error get the name of the page in wxauinotebook

Post by ozkarleo »

I'm using ntb->GetPageText(ntb->GetSelection()) in the AUINOTEBOOK_PAGE_CHANGING event an shows me a message dialog error the same method works in wxpython
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: Error get the name of the page in wxauinotebook

Post by tierra »

It might help to know what the error is.
ozkarleo
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 17, 2015 2:14 am

Re: Error get the name of the page in wxauinotebook

Post by ozkarleo »

here
C:/wxwidgets/include/wx/strvararg.h(532): assert "(argtype & (wxFormatString::Arg_String)) == argtype" failed in wxArgNormalizerWchar<class wxString const &>::wxArgNormalizerWchar(): format specifier doesn't match argument type

call stack:
[00] wxArgNormalizerWchar<wxString>::wxArgNormalizerWchar<wxString> c:/wxwidgets/include/wx/strvararg.h:681
....
DenDev
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 231
Joined: Mon Jan 19, 2015 1:45 pm

Re: Error get the name of the page in wxauinotebook

Post by DenDev »

Try to figure out what "ntb->GetSelection()" returns - since it is an "int" and "ntb->GetPageText()" takes an "size_t" there might be some signing issue. Also; You might want to use "event.GetSelection()" or "event.GetOldSelection()" in the event handler instead.
I have a bad habbit of not testing the code I post :D
iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 282
Joined: Tue Mar 19, 2013 8:52 pm

Re: Error get the name of the page in wxauinotebook

Post by iwbnwif »

I usually observe wxArgNormalizerWchar errors when using wxString::Format or similar.

If this is the case you might be using a %d for a size_t type instead of %lu.
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Post Reply