Changes to match cvs update

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-04-10 18:39:58 +00:00
parent ee018b89b7
commit 7cdaed0ba0
15 changed files with 128 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
# flags and values that affect this script # flags and values that affect this script
#---------------------------------------------------------------------- #----------------------------------------------------------------------
VERSION = "2.3.3pre2" VERSION = "2.3.3pre3"
DESCRIPTION = "Cross platform GUI toolkit for Python" DESCRIPTION = "Cross platform GUI toolkit for Python"
AUTHOR = "Robin Dunn" AUTHOR = "Robin Dunn"
AUTHOR_EMAIL = "Robin Dunn <robin@alldunn.com>" AUTHOR_EMAIL = "Robin Dunn <robin@alldunn.com>"

View File

@@ -1 +1 @@
ver = '2.3.3pre2' ver = '2.3.3pre3'

View File

@@ -451,6 +451,8 @@ enum {
wxPD_ESTIMATED_TIME, wxPD_ESTIMATED_TIME,
wxPD_REMAINING_TIME, wxPD_REMAINING_TIME,
wxDD_NEW_DIR_BUTTON,
wxMENU_TEAROFF, wxMENU_TEAROFF,
wxMB_DOCKABLE, wxMB_DOCKABLE,
wxNO_FULL_REPAINT_ON_RESIZE, wxNO_FULL_REPAINT_ON_RESIZE,

View File

@@ -649,6 +649,8 @@ def wxPyTypeCast(obj, typeStr):
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
class wxPyDeadObjectError(AttributeError):
pass
class _wxPyDeadObject: class _wxPyDeadObject:
""" """
@@ -656,15 +658,21 @@ class _wxPyDeadObject:
changed to this class when the C++ object is deleted. This should help changed to this class when the C++ object is deleted. This should help
prevent crashes due to referencing a bogus C++ pointer. prevent crashes due to referencing a bogus C++ pointer.
""" """
reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
attrStr = "The C++ %s object has been deleted, attribute access no longer allowed."
def __repr__( self ): def __repr__( self ):
if not hasattr(self, "_name"): if not hasattr(self, "_name"):
self._name = "[unknown]" self._name = "[unknown]"
return 'wxPython wrapper for deleted %s object!!! Programming logic error' % self._name return self.reprStr % self._name
def __getattr__( self, *args ): def __getattr__( self, *args ):
if not hasattr(self, "_name"): if not hasattr(self, "_name"):
self._name = "[unknown]" self._name = "[unknown]"
raise ValueError, 'Attempt to access attribute of a deleted %s object' % self._name raise wxPyDeadObjectError( self.attrStr % self._name )
def __nonzero__(self):
return 0
#---------------------------------------------------------------------- #----------------------------------------------------------------------

View File

@@ -1325,7 +1325,7 @@ enum {
wxDIRCTRL_SELECT_FIRST, wxDIRCTRL_SELECT_FIRST,
wxDIRCTRL_SHOW_FILTERS, wxDIRCTRL_SHOW_FILTERS,
wxDIRCTRL_3D_INTERNAL, wxDIRCTRL_3D_INTERNAL,
wxDIRCTRL_EDITABLE, wxDIRCTRL_EDIT_LABELS,
wxID_TREECTRL, wxID_TREECTRL,
wxID_FILTERLISTCTRL, wxID_FILTERLISTCTRL,

View File

@@ -71,9 +71,11 @@ public:
%addmethods { %addmethods {
PyObject* asTuple() { PyObject* asTuple() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
@@ -112,9 +114,11 @@ public:
self->y = y; self->y = y;
} }
PyObject* asTuple() { PyObject* asTuple() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
@@ -160,9 +164,11 @@ public:
self->y = y; self->y = y;
} }
PyObject* asTuple() { PyObject* asTuple() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
@@ -232,11 +238,13 @@ public:
%addmethods { %addmethods {
PyObject* asTuple() { PyObject* asTuple() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4); PyObject* tup = PyTuple_New(4);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
wxPyEndBlockThreads();
return tup; return tup;
} }

View File

@@ -55,7 +55,7 @@
// Put some wx default wxChar* values into wxStrings. // Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorPromptStr);
DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
DECLARE_DEF_STRING(DirSelectorPromptStr);
static const wxString wxPyEmptyString(wxT("")); static const wxString wxPyEmptyString(wxT(""));
%} %}
@@ -83,6 +83,13 @@ wxString wxSaveFileSelector(const wxString& what,
const wxString& default_name = wxPyEmptyString, const wxString& default_name = wxPyEmptyString,
wxWindow *parent = NULL); wxWindow *parent = NULL);
wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
const wxString& defaultPath = wxPyEmptyString,
long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON,
const wxPoint& pos = wxDefaultPosition,
wxWindow *parent = NULL);
wxString wxGetTextFromUser(const wxString& message, wxString wxGetTextFromUser(const wxString& message,
const wxString& caption = wxPyEmptyString, const wxString& caption = wxPyEmptyString,
const wxString& default_value = wxPyEmptyString, const wxString& default_value = wxPyEmptyString,

View File

@@ -11381,7 +11381,7 @@ SWIGEXPORT(void) initcontrols2c() {
PyDict_SetItemString(d,"wxDIRCTRL_SELECT_FIRST", PyInt_FromLong((long) wxDIRCTRL_SELECT_FIRST)); PyDict_SetItemString(d,"wxDIRCTRL_SELECT_FIRST", PyInt_FromLong((long) wxDIRCTRL_SELECT_FIRST));
PyDict_SetItemString(d,"wxDIRCTRL_SHOW_FILTERS", PyInt_FromLong((long) wxDIRCTRL_SHOW_FILTERS)); PyDict_SetItemString(d,"wxDIRCTRL_SHOW_FILTERS", PyInt_FromLong((long) wxDIRCTRL_SHOW_FILTERS));
PyDict_SetItemString(d,"wxDIRCTRL_3D_INTERNAL", PyInt_FromLong((long) wxDIRCTRL_3D_INTERNAL)); PyDict_SetItemString(d,"wxDIRCTRL_3D_INTERNAL", PyInt_FromLong((long) wxDIRCTRL_3D_INTERNAL));
PyDict_SetItemString(d,"wxDIRCTRL_EDITABLE", PyInt_FromLong((long) wxDIRCTRL_EDITABLE)); PyDict_SetItemString(d,"wxDIRCTRL_EDIT_LABELS", PyInt_FromLong((long) wxDIRCTRL_EDIT_LABELS));
PyDict_SetItemString(d,"wxID_TREECTRL", PyInt_FromLong((long) wxID_TREECTRL)); PyDict_SetItemString(d,"wxID_TREECTRL", PyInt_FromLong((long) wxID_TREECTRL));
PyDict_SetItemString(d,"wxID_FILTERLISTCTRL", PyInt_FromLong((long) wxID_FILTERLISTCTRL)); PyDict_SetItemString(d,"wxID_FILTERLISTCTRL", PyInt_FromLong((long) wxID_FILTERLISTCTRL));

View File

@@ -1433,6 +1433,6 @@ wxDIRCTRL_DIR_ONLY = controls2c.wxDIRCTRL_DIR_ONLY
wxDIRCTRL_SELECT_FIRST = controls2c.wxDIRCTRL_SELECT_FIRST wxDIRCTRL_SELECT_FIRST = controls2c.wxDIRCTRL_SELECT_FIRST
wxDIRCTRL_SHOW_FILTERS = controls2c.wxDIRCTRL_SHOW_FILTERS wxDIRCTRL_SHOW_FILTERS = controls2c.wxDIRCTRL_SHOW_FILTERS
wxDIRCTRL_3D_INTERNAL = controls2c.wxDIRCTRL_3D_INTERNAL wxDIRCTRL_3D_INTERNAL = controls2c.wxDIRCTRL_3D_INTERNAL
wxDIRCTRL_EDITABLE = controls2c.wxDIRCTRL_EDITABLE wxDIRCTRL_EDIT_LABELS = controls2c.wxDIRCTRL_EDIT_LABELS
wxID_TREECTRL = controls2c.wxID_TREECTRL wxID_TREECTRL = controls2c.wxID_TREECTRL
wxID_FILTERLISTCTRL = controls2c.wxID_FILTERLISTCTRL wxID_FILTERLISTCTRL = controls2c.wxID_FILTERLISTCTRL

View File

@@ -1401,9 +1401,11 @@ static PyObject *_wrap_wxSize_SetHeight(PyObject *self, PyObject *args, PyObject
} }
static PyObject * wxSize_asTuple(wxSize *self) { static PyObject * wxSize_asTuple(wxSize *self) {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
static PyObject *_wrap_wxSize_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxSize_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) {
@@ -1671,9 +1673,11 @@ static PyObject *_wrap_wxRealPoint_Set(PyObject *self, PyObject *args, PyObject
} }
static PyObject * wxRealPoint_asTuple(wxRealPoint *self) { static PyObject * wxRealPoint_asTuple(wxRealPoint *self) {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
static PyObject *_wrap_wxRealPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxRealPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) {
@@ -2021,9 +2025,11 @@ static PyObject *_wrap_wxPoint_Set(PyObject *self, PyObject *args, PyObject *kwa
} }
static PyObject * wxPoint_asTuple(wxPoint *self) { static PyObject * wxPoint_asTuple(wxPoint *self) {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2); PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
return tup; return tup;
} }
static PyObject *_wrap_wxPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) {
@@ -3007,11 +3013,13 @@ static PyObject *_wrap_wxRect_height_get(PyObject *self, PyObject *args, PyObjec
} }
static PyObject * wxRect_asTuple(wxRect *self) { static PyObject * wxRect_asTuple(wxRect *self) {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4); PyObject* tup = PyTuple_New(4);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
wxPyEndBlockThreads();
return tup; return tup;
} }
static PyObject *_wrap_wxRect_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxRect_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) {

View File

@@ -103,7 +103,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
// Put some wx default wxChar* values into wxStrings. // Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorPromptStr);
DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
DECLARE_DEF_STRING(DirSelectorPromptStr);
static const wxString wxPyEmptyString(wxT("")); static const wxString wxPyEmptyString(wxT(""));
int wxCaret_GetBlinkTime() { int wxCaret_GetBlinkTime() {
@@ -515,6 +515,76 @@ static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObje
return _resultobj; return _resultobj;
} }
static PyObject *_wrap_wxDirSelector(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxString * _arg0 = (wxString *) &wxPyDirSelectorPromptStr;
wxString * _arg1 = (wxString *) &wxPyEmptyString;
long _arg2 = (long ) wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxDD_NEW_DIR_BUTTON;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxWindow * _arg4 = (wxWindow *) NULL;
PyObject * _obj0 = 0;
PyObject * _obj1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
PyObject * _argo4 = 0;
char *_kwnames[] = { "message","defaultPath","style","pos","parent", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOlOO:wxDirSelector",_kwnames,&_obj0,&_obj1,&_arg2,&_obj3,&_argo4))
return NULL;
if (_obj0)
{
_arg0 = wxString_in_helper(_obj0);
if (_arg0 == NULL)
return NULL;
}
if (_obj1)
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
if (_obj3)
{
_arg3 = &temp;
if (! wxPoint_helper(_obj3, &_arg3))
return NULL;
}
if (_argo4) {
if (_argo4 == Py_None) { _arg4 = NULL; }
else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxDirSelector. Expected _wxWindow_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxString (wxDirSelector(*_arg0,*_arg1,_arg2,*_arg3,_arg4));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
{
if (_obj0)
delete _arg0;
}
{
if (_obj1)
delete _arg1;
}
{
delete _result;
}
return _resultobj;
}
static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
wxString * _result; wxString * _result;
@@ -10056,6 +10126,7 @@ static PyMethodDef misc2cMethods[] = {
{ "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS }, { "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS },
{ "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS },
{ "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS },
{ "wxDirSelector", (PyCFunction) _wrap_wxDirSelector, METH_VARARGS | METH_KEYWORDS },
{ "wxSaveFileSelector", (PyCFunction) _wrap_wxSaveFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxSaveFileSelector", (PyCFunction) _wrap_wxSaveFileSelector, METH_VARARGS | METH_KEYWORDS },
{ "wxLoadFileSelector", (PyCFunction) _wrap_wxLoadFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxLoadFileSelector", (PyCFunction) _wrap_wxLoadFileSelector, METH_VARARGS | METH_KEYWORDS },
{ "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS },

View File

@@ -963,6 +963,8 @@ wxLoadFileSelector = misc2c.wxLoadFileSelector
wxSaveFileSelector = misc2c.wxSaveFileSelector wxSaveFileSelector = misc2c.wxSaveFileSelector
wxDirSelector = misc2c.wxDirSelector
wxGetTextFromUser = misc2c.wxGetTextFromUser wxGetTextFromUser = misc2c.wxGetTextFromUser
wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser

View File

@@ -2129,6 +2129,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxPD_ELAPSED_TIME", PyInt_FromLong((long) wxPD_ELAPSED_TIME)); PyDict_SetItemString(d,"wxPD_ELAPSED_TIME", PyInt_FromLong((long) wxPD_ELAPSED_TIME));
PyDict_SetItemString(d,"wxPD_ESTIMATED_TIME", PyInt_FromLong((long) wxPD_ESTIMATED_TIME)); PyDict_SetItemString(d,"wxPD_ESTIMATED_TIME", PyInt_FromLong((long) wxPD_ESTIMATED_TIME));
PyDict_SetItemString(d,"wxPD_REMAINING_TIME", PyInt_FromLong((long) wxPD_REMAINING_TIME)); PyDict_SetItemString(d,"wxPD_REMAINING_TIME", PyInt_FromLong((long) wxPD_REMAINING_TIME));
PyDict_SetItemString(d,"wxDD_NEW_DIR_BUTTON", PyInt_FromLong((long) wxDD_NEW_DIR_BUTTON));
PyDict_SetItemString(d,"wxMENU_TEAROFF", PyInt_FromLong((long) wxMENU_TEAROFF)); PyDict_SetItemString(d,"wxMENU_TEAROFF", PyInt_FromLong((long) wxMENU_TEAROFF));
PyDict_SetItemString(d,"wxMB_DOCKABLE", PyInt_FromLong((long) wxMB_DOCKABLE)); PyDict_SetItemString(d,"wxMB_DOCKABLE", PyInt_FromLong((long) wxMB_DOCKABLE));
PyDict_SetItemString(d,"wxNO_FULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxNO_FULL_REPAINT_ON_RESIZE)); PyDict_SetItemString(d,"wxNO_FULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxNO_FULL_REPAINT_ON_RESIZE));

View File

@@ -415,6 +415,7 @@ wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT
wxPD_ELAPSED_TIME = wxc.wxPD_ELAPSED_TIME wxPD_ELAPSED_TIME = wxc.wxPD_ELAPSED_TIME
wxPD_ESTIMATED_TIME = wxc.wxPD_ESTIMATED_TIME wxPD_ESTIMATED_TIME = wxc.wxPD_ESTIMATED_TIME
wxPD_REMAINING_TIME = wxc.wxPD_REMAINING_TIME wxPD_REMAINING_TIME = wxc.wxPD_REMAINING_TIME
wxDD_NEW_DIR_BUTTON = wxc.wxDD_NEW_DIR_BUTTON
wxMENU_TEAROFF = wxc.wxMENU_TEAROFF wxMENU_TEAROFF = wxc.wxMENU_TEAROFF
wxMB_DOCKABLE = wxc.wxMB_DOCKABLE wxMB_DOCKABLE = wxc.wxMB_DOCKABLE
wxNO_FULL_REPAINT_ON_RESIZE = wxc.wxNO_FULL_REPAINT_ON_RESIZE wxNO_FULL_REPAINT_ON_RESIZE = wxc.wxNO_FULL_REPAINT_ON_RESIZE
@@ -1556,6 +1557,8 @@ def wxPyTypeCast(obj, typeStr):
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
class wxPyDeadObjectError(AttributeError):
pass
class _wxPyDeadObject: class _wxPyDeadObject:
""" """
@@ -1563,15 +1566,21 @@ class _wxPyDeadObject:
changed to this class when the C++ object is deleted. This should help changed to this class when the C++ object is deleted. This should help
prevent crashes due to referencing a bogus C++ pointer. prevent crashes due to referencing a bogus C++ pointer.
""" """
reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
attrStr = "The C++ %s object has been deleted, attribute access no longer allowed."
def __repr__( self ): def __repr__( self ):
if not hasattr(self, "_name"): if not hasattr(self, "_name"):
self._name = "[unknown]" self._name = "[unknown]"
return 'wxPython wrapper for deleted %s object!!! Programming logic error' % self._name return self.reprStr % self._name
def __getattr__( self, *args ): def __getattr__( self, *args ):
if not hasattr(self, "_name"): if not hasattr(self, "_name"):
self._name = "[unknown]" self._name = "[unknown]"
raise ValueError, 'Attempt to access attribute of a deleted %s object' % self._name raise wxPyDeadObjectError( self.attrStr % self._name )
def __nonzero__(self):
return 0
#---------------------------------------------------------------------- #----------------------------------------------------------------------

View File

@@ -12,6 +12,7 @@
%module wx %module wx
%{ %{
#include "helpers.h" #include "helpers.h"
%} %}