From 2d2fb2f198218b5691e77906e186baa9a6c7129f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 18 Sep 2002 20:44:35 +0000 Subject: [PATCH] SWIGged update for wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/stc/gtk/stc_.py | 4 ++-- wxPython/src/gtk/windows.cpp | 30 ++++++++++++++++++++++++++++++ wxPython/src/gtk/windows.py | 3 +++ wxPython/src/gtk/wx.py | 6 +++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/wxPython/contrib/stc/gtk/stc_.py b/wxPython/contrib/stc/gtk/stc_.py index 283ac7527d..6a5b12ac93 100644 --- a/wxPython/contrib/stc/gtk/stc_.py +++ b/wxPython/contrib/stc/gtk/stc_.py @@ -1819,5 +1819,5 @@ wxEVT_STC_ZOOM = stc_c.wxEVT_STC_ZOOM wx.wxStyledTextEventPtr = wxStyledTextEventPtr wx.wxStyledTextCtrlPtr = wxStyledTextCtrlPtr - -wxSTC_CARET_CENTER = wxSTC_CARET_STRICT +# This constant no longer exists in Scintilla, but I'll put it here for a while to avoid disrupting user code... +wxSTC_CARET_CENTER = 0 diff --git a/wxPython/src/gtk/windows.cpp b/wxPython/src/gtk/windows.cpp index c89603067a..2283f7a66e 100644 --- a/wxPython/src/gtk/windows.cpp +++ b/wxPython/src/gtk/windows.cpp @@ -9978,6 +9978,35 @@ static PyObject *_wrap_wxMenuBar_EnableTop(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxMenuBar_IsEnabledTop(_swigobj,_swigarg0) (_swigobj->IsEnabledTop(_swigarg0)) +static PyObject *_wrap_wxMenuBar_IsEnabledTop(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxMenuBar * _arg0; + size_t _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","pos", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxMenuBar_IsEnabledTop",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenuBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuBar_IsEnabledTop. Expected _wxMenuBar_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxMenuBar_IsEnabledTop(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxMenuBar_SetLabelTop(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetLabelTop(_swigarg0,_swigarg1)) static PyObject *_wrap_wxMenuBar_SetLabelTop(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -11377,6 +11406,7 @@ static PyMethodDef windowscMethods[] = { { "wxMenuBar_FindMenu", (PyCFunction) _wrap_wxMenuBar_FindMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_GetLabelTop", (PyCFunction) _wrap_wxMenuBar_GetLabelTop, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_SetLabelTop", (PyCFunction) _wrap_wxMenuBar_SetLabelTop, METH_VARARGS | METH_KEYWORDS }, + { "wxMenuBar_IsEnabledTop", (PyCFunction) _wrap_wxMenuBar_IsEnabledTop, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_EnableTop", (PyCFunction) _wrap_wxMenuBar_EnableTop, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_Remove", (PyCFunction) _wrap_wxMenuBar_Remove, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_Replace", (PyCFunction) _wrap_wxMenuBar_Replace, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py index 757dd2a53b..d549d1ccf7 100644 --- a/wxPython/src/gtk/windows.py +++ b/wxPython/src/gtk/windows.py @@ -977,6 +977,9 @@ class wxMenuBarPtr(wxWindowPtr): def EnableTop(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_EnableTop,(self,) + _args, _kwargs) return val + def IsEnabledTop(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuBar_IsEnabledTop,(self,) + _args, _kwargs) + return val def SetLabelTop(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_SetLabelTop,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index 627080b5ae..d67821e25a 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -1691,10 +1691,14 @@ class wxApp(wxPyApp): error = 'wxApp.error' outputWindowClass = wxPyOnDemandOutputWindow - def __init__(self, redirect=_defRedirect, filename=None): + def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=true): wxPyApp.__init__(self) self.stdioWin = None self.saveStdio = (sys.stdout, sys.stderr) + + # This has to be done before OnInit + self.SetUseBestVisual(useBestVisual) + if redirect: self.RedirectStdio(filename) # this initializes wxWindows and then calls our OnInit