%newgroup
+MustHaveApp(wxFont);
+MustHaveApp(wxFont::GetDefaultEncoding);
+MustHaveApp(wxFont::SetDefaultEncoding);
+
class wxFont : public wxGDIObject {
public:
+ %pythonPrepend wxFont "if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']"
+
wxFont( int pointSize, int family, int style, int weight,
bool underline=False, const wxString& face = wxPyEmptyString,
wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
}
%name(Font2) wxFont(int pointSize,
- wxFontFamily family,
- int flags = wxFONTFLAG_DEFAULT,
- const wxString& face = wxPyEmptyString,
- wxFontEncoding encoding = wxFONTENCODING_DEFAULT) {
+ wxFontFamily family,
+ int flags = wxFONTFLAG_DEFAULT,
+ const wxString& face = wxPyEmptyString,
+ wxFontEncoding encoding = wxFONTENCODING_DEFAULT) {
return wxFont::New(pointSize, family, flags, face, encoding);
}
}
// Unofficial API, don't use
virtual void SetNoAntiAliasing( bool no = True );
- virtual bool GetNoAntiAliasing();
+ virtual bool GetNoAntiAliasing() const;
// the default encoding is used for creating all fonts with default
// encoding parameter
%}
+MustHaveApp(wxPyFontEnumerator);
+
%name(FontEnumerator) class wxPyFontEnumerator {
public:
%pythonAppend wxPyFontEnumerator "self._setCallbackInfo(self, FontEnumerator, 0)"
%extend {
PyObject* GetEncodings() {
wxArrayString* arr = self->GetEncodings();
- return wxArrayString2PyList_helper(*arr);
+ if (arr)
+ return wxArrayString2PyList_helper(*arr);
+ else
+ return PyList_New(0);
}
PyObject* GetFacenames() {
wxArrayString* arr = self->GetFacenames();
- return wxArrayString2PyList_helper(*arr);
+ if (arr)
+ return wxArrayString2PyList_helper(*arr);
+ else
+ return PyList_New(0);
}
}
};