X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8815349a371e4f86be67e95d52f98c768dd97902..303f572ea95a88622fd93b33008de75f756ff068:/wxPython/src/_datetime.i diff --git a/wxPython/src/_datetime.i b/wxPython/src/_datetime.i index d5d47b6e2b..4bba1d2124 100644 --- a/wxPython/src/_datetime.i +++ b/wxPython/src/_datetime.i @@ -363,11 +363,24 @@ public: static wxString GetWeekDayName(WeekDay weekday, NameFlags flags = Name_Full); - DocDeclAStr( - static void, GetAmPmStrings(wxString *OUTPUT, wxString *OUTPUT), - "GetAmPmStrings() -> (am, pm)", - "Get the AM and PM strings in the current locale (may be empty)", ""); - + %extend { + DocAStr( + GetAmPmStrings, + "GetAmPmStrings() -> (am, pm)", + "Get the AM and PM strings in the current locale (may be empty)", ""); + static PyObject* GetAmPmStrings() { + wxString am; + wxString pm; + wxDateTime::GetAmPmStrings(&am, &pm); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); + PyObject* tup = PyTuple_New(2); + PyTuple_SET_ITEM(tup, 0, wx2PyString(am)); + PyTuple_SET_ITEM(tup, 1, wx2PyString(pm)); + wxPyEndBlockThreads(blocked); + return tup; + } + } + // return True if the given country uses DST for this year static bool IsDSTApplicable(int year = Inv_Year, Country country = Country_Default);