Page 1 of 1

Error get the name of the page in wxauinotebook

Posted: Tue Mar 17, 2015 2:25 am
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

Re: Error get the name of the page in wxauinotebook

Posted: Tue Mar 17, 2015 5:41 am
by tierra
It might help to know what the error is.

Re: Error get the name of the page in wxauinotebook

Posted: Wed Apr 08, 2015 2:33 am
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
....

Re: Error get the name of the page in wxauinotebook

Posted: Wed Apr 08, 2015 10:59 am
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.

Re: Error get the name of the page in wxauinotebook

Posted: Wed Apr 08, 2015 4:54 pm
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.