From 9859d369b49e35a1cad0f760173e165f974fb6cb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 3 Apr 2007 18:42:01 +0000 Subject: [PATCH] Use our own getters and properties for wxVisualAttributes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_window.i | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 8a46dd75ca..2935cb31c1 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -34,15 +34,27 @@ struct wxVisualAttributes ~wxVisualAttributes() { delete self; } } - // the font used for control label/text inside it - wxFont font; - - // the foreground colour - wxColour colFg; +// // the font used for control label/text inside it +// wxFont font; +// // the foreground colour +// wxColour colFg; +// // the background colour, may be wxNullColour if the controls background +// // colour is not solid +// wxColour colBg; + + // Use our own getters and properties instead of the ones that SWIG will + // generate, so copies of the attributes will be made when they are + // accessed, instead of using a pointer to the one in the object which may + // be temporary. + %extend { + wxFont _get_font() { return self->font; } + wxColour _get_colFg() { return self->colFg; } + wxColour _get_colBg() { return self->colBg; } + } - // the background colour, may be wxNullColour if the controls background - // colour is not solid - wxColour colBg; + %property(font, _get_font) + %property(colFg, _get_colFg) + %property(colBg, _get_colBg) }; -- 2.45.2