More updates.

Began splitting up wxEntry so wxPython can use the bits it needs
instead of copying code.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2000-03-11 07:24:00 +00:00
parent 4c9993c3c7
commit 7ff49f0c73
18 changed files with 192 additions and 3921 deletions

View File

@ -72,12 +72,12 @@ class RunDemoApp(wxApp):
#----------------------------------------------------------------------------
def main():
if len(sys.argv) != 2:
def main(argv):
if len(argv) != 2:
print "Please specify a demo module name on the command-line"
raise SystemExit
name = sys.argv[1]
name = argv[1]
module = __import__(name)
@ -87,6 +87,6 @@ def main():
if __name__ == "__main__":
main()
main(sys.argv)

View File

@ -5,10 +5,6 @@ MODULE = 'glcanvasc'
SWIGFILES = ['glcanvas.i', ]
# Special action; for win32 we require you make the glcanvas lib. The
# makefile will copy it to WXWIN\lib
# Unix make system isn't so advanced, so we'll go looking for the source
# file ourselves...
if sys.platform == 'win32':
# OTHERLIBS = '$(WXDIR)\lib\glcanvas$(LIBEXT).lib glu32.lib opengl32.lib'
# OTHERCFLAGS = '-DWITH_GLCANVAS -I$(WXDIR)/utils/glcanvas/win'
@ -16,18 +12,8 @@ if sys.platform == 'win32':
else:
# SOURCES = [GENCODEDIR+'/_glcanvas.cpp']
print "Warning: Assuming MesaGL libraries. Override OTHERLIBS in build.local\n"\
" if you have native GL!"
OTHERCFLAGS = '-DWITH_GLCANVAS -I$(WXDIR)/utils/glcanvas/gtk'
OTHERLIBS = "-lwxglcanvas -lMesaGL -lMesaGLU"
# OTHERRULES = """
#$(GENCODEDIR)/_glcanvas.cpp : $(WXDIR)/utils/glcanvas/$(GENCODEDIR)/glcanvas.cpp
# cp $< $@
#glcanvas.h : $(WXDIR)/utils/glcanvas/$(GENCODEDIR)/glcanvas.h
# cp $< $@
#_glcanvas.o : glcanvas.h
#"""
OTHERLIBS = "-lwx_gtk_gl -lMesaGL -lMesaGLU"

View File

@ -54,7 +54,7 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "glcanvasc"
#include "helpers.h"
#include <glcanvas.h>
#include <wx/glcanvas.h>
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
@ -714,7 +714,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxTreeCtrl","_wxTreeCtrl",0},
{ "_wxMask","_class_wxMask",0},
{ "_wxToolTip","_class_wxToolTip",0},
{ "_wxGrid","_class_wxGrid",0},
{ "_wxPNGHandler","_class_wxPNGHandler",0},
{ "_class_wxColourData","_wxColourData",0},
{ "_class_wxPageSetupDialogData","_wxPageSetupDialogData",0},
@ -784,7 +783,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxTextDataObject","_class_wxTextDataObject",0},
{ "_class_wxKeyEvent","_wxKeyEvent",0},
{ "_class_wxToolTip","_wxToolTip",0},
{ "_class_wxGrid","_wxGrid",0},
{ "_class_wxPNGHandler","_wxPNGHandler",0},
{ "_wxColour","_class_wxColour",0},
{ "_class_wxDialog","_wxDialog",0},
@ -817,7 +815,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxEvent","_wxEvent",0},
{ "_wxCheckListBox","_class_wxCheckListBox",0},
{ "_wxSplitterEvent","_class_wxSplitterEvent",0},
{ "_wxGridEvent","_class_wxGridEvent",0},
{ "_wxRect","_class_wxRect",0},
{ "_wxCommandEvent","_class_wxCommandEvent",0},
{ "_wxSizeEvent","_class_wxSizeEvent",0},
@ -942,7 +939,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
{ "_class_wxRadioBox","_wxRadioBox",0},
{ "_wxGridCell","_class_wxGridCell",0},
{ "_class_wxBoxSizer","_wxBoxSizer",0},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
@ -1077,14 +1073,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxGLCanvas","_wxGLCanvas",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxGridCell","_wxGridCell",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_wxBitmap",0},
{ "_class_wxMemoryDC","_wxMemoryDC",0},

View File

@ -11,7 +11,7 @@ OTHERCFLAGS = '-I$(WXWIN)/contrib/include'
if sys.platform == 'win32':
OTHERLIBS = '$(WXWIN)/contrib/lib/ogl$(LIBEXT).lib'
else:
OTHERLIBS = '-logl'
OTHERLIBS = '-L$(WXWIN)/build/contrib/lib -logl'
#OTHERSWIGFLAGS = '-stat'
SWIGDEPS = '_ogldefs.i'

View File

@ -1,5 +1,5 @@
/*
* FILE : ./oglbasic.cpp
* FILE : oglbasic.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)

View File

@ -111,6 +111,24 @@ static char* wxStringErrorMsg = "string type is required for parameter";
extern wxValidator wxPyDefaultValidator;
int wxCALLBACK wxPyTreeCtrl_SortItems(long item1, long item2, long funcPtr) {
int retval = 0;
PyObject* func = (PyObject*)funcPtr;
bool doSave = wxPyRestoreThread();
PyObject* args = Py_BuildValue("(ii)", item1, item2);
PyObject* result = PyEval_CallObject(func, args);
Py_DECREF(args);
if (result) {
retval = PyInt_AsLong(result);
Py_DECREF(result);
}
wxPySaveThread(doSave);
return retval;
}
class wxPyTreeItemData : public wxTreeItemData {
public:
wxPyTreeItemData(PyObject* obj = NULL) {
@ -2850,6 +2868,43 @@ static PyObject *_wrap_wxListCtrl_SetWindowStyleFlag(PyObject *self, PyObject *a
return _resultobj;
}
static bool wxListCtrl_SortItems(wxListCtrl *self,PyObject * func) {
if (!PyCallable_Check(func))
return FALSE;
return self->SortItems(wxPyTreeCtrl_SortItems, (long)func);
}
static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxListCtrl * _arg0;
PyObject * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","func", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SortItems",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SortItems. Expected _wxListCtrl_p.");
return NULL;
}
}
{
_arg1 = _obj1;
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxListCtrl_SortItems(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define new_wxTreeItemId() (new wxTreeItemId())
static PyObject *_wrap_new_wxTreeItemId(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@ -5788,6 +5843,7 @@ static PyMethodDef controls2cMethods[] = {
{ "wxTreeItemId_IsOk", (PyCFunction) _wrap_wxTreeItemId_IsOk, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxTreeItemId", (PyCFunction) _wrap_delete_wxTreeItemId, METH_VARARGS | METH_KEYWORDS },
{ "new_wxTreeItemId", (PyCFunction) _wrap_new_wxTreeItemId, METH_VARARGS | METH_KEYWORDS },
{ "wxListCtrl_SortItems", (PyCFunction) _wrap_wxListCtrl_SortItems, METH_VARARGS | METH_KEYWORDS },
{ "wxListCtrl_SetWindowStyleFlag", (PyCFunction) _wrap_wxListCtrl_SetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS },
{ "wxListCtrl_SetSingleStyle", (PyCFunction) _wrap_wxListCtrl_SetSingleStyle, METH_VARARGS | METH_KEYWORDS },
{ "wxListCtrl_SetItemText", (PyCFunction) _wrap_wxListCtrl_SetItemText, METH_VARARGS | METH_KEYWORDS },

View File

@ -285,6 +285,9 @@ class wxListCtrlPtr(wxControlPtr):
def SetWindowStyleFlag(self, *_args, **_kwargs):
val = apply(controls2c.wxListCtrl_SetWindowStyleFlag,(self,) + _args, _kwargs)
return val
def SortItems(self, *_args, **_kwargs):
val = apply(controls2c.wxListCtrl_SortItems,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxListCtrl instance at %s>" % (self.this,)
class wxListCtrl(wxListCtrlPtr):

View File

@ -114,9 +114,14 @@ static char* wxStringErrorMsg = "string type is required for parameter";
}
#ifdef __WXMSW__
wxBitmap* wxBitmapFromData(char* data, long type,
wxBitmap* wxBitmapFromData(PyObject* data, long type,
int width, int height, int depth = 1) {
return new wxBitmap((void*)data, type, width, height, depth);
if (! PyString_Check(data)) {
PyErr_SetString(PyExc_TypeError, "Expected string object");
return NULL;
}
return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth);
}
#endif
@ -6793,7 +6798,7 @@ static PyObject *_wrap_new_wxImageList(PyObject *self, PyObject *args, PyObject
wxImageList * _result;
int _arg0;
int _arg1;
int _arg2 = (int ) FALSE;
int _arg2 = (int ) TRUE;
int _arg3 = (int ) 1;
char *_kwnames[] = { "width","height","mask","initialCount", NULL };
char _ptemp[128];

View File

@ -5802,6 +5802,53 @@ static PyObject *_wrap_wxScrolledWindow_SetTargetWindow(PyObject *self, PyObject
return _resultobj;
}
#define wxScrolledWindow_GetViewStart(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetViewStart(_swigarg0,_swigarg1))
static PyObject *_wrap_wxScrolledWindow_GetViewStart(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxScrolledWindow * _arg0;
int * _arg1;
int temp;
int * _arg2;
int temp0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
{
_arg1 = &temp;
}
{
_arg2 = &temp0;
}
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_GetViewStart",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_GetViewStart. Expected _wxScrolledWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxScrolledWindow_GetViewStart(_arg0,_arg1,_arg2);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
PyObject *o;
o = PyInt_FromLong((long) (*_arg1));
_resultobj = t_output_helper(_resultobj, o);
}
{
PyObject *o;
o = PyInt_FromLong((long) (*_arg2));
_resultobj = t_output_helper(_resultobj, o);
}
return _resultobj;
}
#define wxScrolledWindow_ViewStart(_swigobj,_swigarg0,_swigarg1) (_swigobj->ViewStart(_swigarg0,_swigarg1))
static PyObject *_wrap_wxScrolledWindow_ViewStart(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@ -8005,7 +8052,7 @@ static PyObject *_wrap_new_wxMenuItem(PyObject *self, PyObject *args, PyObject *
PyObject * _resultobj;
wxMenuItem * _result;
wxMenu * _arg0 = (wxMenu *) NULL;
int _arg1 = (int ) ID_SEPARATOR;
int _arg1 = (int ) wxID_SEPARATOR;
wxString * _arg2 = (wxString *) &wxPyEmptyStr;
wxString * _arg3 = (wxString *) &wxPyEmptyStr;
bool _arg4 = (bool ) FALSE;
@ -8811,6 +8858,7 @@ static PyMethodDef windowscMethods[] = {
{ "wxScrolledWindow_CalcUnscrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_CalcScrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_ViewStart", (PyCFunction) _wrap_wxScrolledWindow_ViewStart, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_GetViewStart", (PyCFunction) _wrap_wxScrolledWindow_GetViewStart, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_SetTargetWindow", (PyCFunction) _wrap_wxScrolledWindow_SetTargetWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_SetScrollPageSize", (PyCFunction) _wrap_wxScrolledWindow_SetScrollPageSize, METH_VARARGS | METH_KEYWORDS },
{ "wxScrolledWindow_SetScrollbars", (PyCFunction) _wrap_wxScrolledWindow_SetScrollbars, METH_VARARGS | METH_KEYWORDS },

View File

@ -628,6 +628,9 @@ class wxScrolledWindowPtr(wxPanelPtr):
def SetTargetWindow(self, *_args, **_kwargs):
val = apply(windowsc.wxScrolledWindow_SetTargetWindow,(self,) + _args, _kwargs)
return val
def GetViewStart(self, *_args, **_kwargs):
val = apply(windowsc.wxScrolledWindow_GetViewStart,(self,) + _args, _kwargs)
return val
def ViewStart(self, *_args, **_kwargs):
val = apply(windowsc.wxScrolledWindow_ViewStart,(self,) + _args, _kwargs)
return val

File diff suppressed because it is too large Load Diff

View File

@ -13,378 +13,6 @@ from controls import *
from events import *
import wx
class wxGridCellPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,windows2c=windows2c):
if self.thisown == 1 :
windows2c.delete_wxGridCell(self)
def GetTextValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetTextValue,(self,) + _args, _kwargs)
return val
def SetTextValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetTextValue,(self,) + _args, _kwargs)
return val
def GetFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def SetFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetFont,(self,) + _args, _kwargs)
return val
def GetTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetTextColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def SetTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetTextColour,(self,) + _args, _kwargs)
return val
def GetBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetBackgroundColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def SetBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetBackgroundColour,(self,) + _args, _kwargs)
return val
def GetBackgroundBrush(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetBackgroundBrush,(self,) + _args, _kwargs)
if val: val = wxBrushPtr(val)
return val
def GetAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetAlignment,(self,) + _args, _kwargs)
return val
def SetAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetAlignment,(self,) + _args, _kwargs)
return val
def GetCellBitmap(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_GetCellBitmap,(self,) + _args, _kwargs)
if val: val = wxBitmapPtr(val)
return val
def SetCellBitmap(self, *_args, **_kwargs):
val = apply(windows2c.wxGridCell_SetCellBitmap,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGridCell instance at %s>" % (self.this,)
class wxGridCell(wxGridCellPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows2c.new_wxGridCell,_args,_kwargs)
self.thisown = 1
class wxGridPtr(wxPanelPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def AdjustScrollbars(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_AdjustScrollbars,(self,) + _args, _kwargs)
return val
def AppendCols(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_AppendCols,(self,) + _args, _kwargs)
return val
def AppendRows(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_AppendRows,(self,) + _args, _kwargs)
return val
def BeginBatch(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_BeginBatch,(self,) + _args, _kwargs)
return val
def CellHitTest(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_CellHitTest,(self,) + _args, _kwargs)
return val
def CreateGrid(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_CreateGrid,(self,) + _args, _kwargs)
return val
def CurrentCellVisible(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_CurrentCellVisible,(self,) + _args, _kwargs)
return val
def DeleteCols(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_DeleteCols,(self,) + _args, _kwargs)
return val
def DeleteRows(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_DeleteRows,(self,) + _args, _kwargs)
return val
def EndBatch(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_EndBatch,(self,) + _args, _kwargs)
return val
def GetBatchCount(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetBatchCount,(self,) + _args, _kwargs)
return val
def GetCell(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCell,(self,) + _args, _kwargs)
if val: val = wxGridCellPtr(val)
return val
def GetCellAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCellAlignment,(self,) + _args, _kwargs)
return val
def GetDefCellAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetDefCellAlignment,(self,) + _args, _kwargs)
return val
def GetCellBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCellBackgroundColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetDefCellBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetDefCellBackgroundColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetCells(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCells,(self,) + _args, _kwargs)
return val
def GetCellTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCellTextColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetDefCellTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetDefCellTextColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetCellTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCellTextFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def GetDefCellTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetDefCellTextFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def GetCellValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCellValue,(self,) + _args, _kwargs)
return val
def GetCols(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCols,(self,) + _args, _kwargs)
return val
def GetColumnWidth(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetColumnWidth,(self,) + _args, _kwargs)
return val
def GetCurrentRect(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCurrentRect,(self,) + _args, _kwargs)
if val: val = wxRectPtr(val) ; val.thisown = 1
return val
def GetCursorColumn(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCursorColumn,(self,) + _args, _kwargs)
return val
def GetCursorRow(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetCursorRow,(self,) + _args, _kwargs)
return val
def GetEditable(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetEditable,(self,) + _args, _kwargs)
return val
def GetHorizScrollBar(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetHorizScrollBar,(self,) + _args, _kwargs)
if val: val = wxScrollBarPtr(val)
return val
def GetLabelAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelAlignment,(self,) + _args, _kwargs)
return val
def GetLabelBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelBackgroundColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetLabelSize(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelSize,(self,) + _args, _kwargs)
return val
def GetLabelTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelTextColour,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetLabelTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelTextFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def GetLabelValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetLabelValue,(self,) + _args, _kwargs)
return val
def GetRowHeight(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetRowHeight,(self,) + _args, _kwargs)
return val
def GetRows(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetRows,(self,) + _args, _kwargs)
return val
def GetScrollPosX(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetScrollPosX,(self,) + _args, _kwargs)
return val
def GetScrollPosY(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetScrollPosY,(self,) + _args, _kwargs)
return val
def GetTextItem(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetTextItem,(self,) + _args, _kwargs)
if val: val = wxTextCtrlPtr(val)
return val
def GetVertScrollBar(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetVertScrollBar,(self,) + _args, _kwargs)
if val: val = wxScrollBarPtr(val)
return val
def InsertCols(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_InsertCols,(self,) + _args, _kwargs)
return val
def InsertRows(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_InsertRows,(self,) + _args, _kwargs)
return val
def OnActivate(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_OnActivate,(self,) + _args, _kwargs)
return val
def SetCellAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetCellAlignment,(self,) + _args, _kwargs)
return val
def SetDefCellAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetDefCellAlignment,(self,) + _args, _kwargs)
return val
def SetCellBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetCellBackgroundColour,(self,) + _args, _kwargs)
return val
def SetDefCellBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetDefCellBackgroundColour,(self,) + _args, _kwargs)
return val
def SetCellTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetCellTextColour,(self,) + _args, _kwargs)
return val
def SetDefCellTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetDefCellTextColour,(self,) + _args, _kwargs)
return val
def SetCellTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetCellTextFont,(self,) + _args, _kwargs)
return val
def SetDefCellTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetDefCellTextFont,(self,) + _args, _kwargs)
return val
def SetCellValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetCellValue,(self,) + _args, _kwargs)
return val
def SetColumnWidth(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetColumnWidth,(self,) + _args, _kwargs)
return val
def SetDividerPen(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetDividerPen,(self,) + _args, _kwargs)
return val
def SetEditable(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetEditable,(self,) + _args, _kwargs)
return val
def SetGridCursor(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetGridCursor,(self,) + _args, _kwargs)
return val
def SetLabelAlignment(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelAlignment,(self,) + _args, _kwargs)
return val
def SetLabelBackgroundColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelBackgroundColour,(self,) + _args, _kwargs)
return val
def SetLabelSize(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelSize,(self,) + _args, _kwargs)
return val
def SetLabelTextColour(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelTextColour,(self,) + _args, _kwargs)
return val
def SetLabelTextFont(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelTextFont,(self,) + _args, _kwargs)
return val
def SetLabelValue(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetLabelValue,(self,) + _args, _kwargs)
return val
def SetRowHeight(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetRowHeight,(self,) + _args, _kwargs)
return val
def UpdateDimensions(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_UpdateDimensions,(self,) + _args, _kwargs)
return val
def GetEditInPlace(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_GetEditInPlace,(self,) + _args, _kwargs)
return val
def SetEditInPlace(self, *_args, **_kwargs):
val = apply(windows2c.wxGrid_SetEditInPlace,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGrid instance at %s>" % (self.this,)
class wxGrid(wxGridPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows2c.new_wxGrid,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)
wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)
wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)
wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)
wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)
wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)
wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)
wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)
wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)
class wxGridEventPtr(wxEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def GetRow(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_GetRow,(self,) + _args, _kwargs)
return val
def GetCol(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_GetCol,(self,) + _args, _kwargs)
return val
def GetPosition(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_GetPosition,(self,) + _args, _kwargs)
if val: val = wxPointPtr(val) ; val.thisown = 1
return val
def ControlDown(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_ControlDown,(self,) + _args, _kwargs)
return val
def ShiftDown(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_ShiftDown,(self,) + _args, _kwargs)
return val
def GetCell(self, *_args, **_kwargs):
val = apply(windows2c.wxGridEvent_GetCell,(self,) + _args, _kwargs)
if val: val = wxGridCellPtr(val)
return val
def __setattr__(self,name,value):
if name == "m_row" :
windows2c.wxGridEvent_m_row_set(self,value)
return
if name == "m_col" :
windows2c.wxGridEvent_m_col_set(self,value)
return
if name == "m_x" :
windows2c.wxGridEvent_m_x_set(self,value)
return
if name == "m_y" :
windows2c.wxGridEvent_m_y_set(self,value)
return
if name == "m_control" :
windows2c.wxGridEvent_m_control_set(self,value)
return
if name == "m_shift" :
windows2c.wxGridEvent_m_shift_set(self,value)
return
if name == "m_cell" :
windows2c.wxGridEvent_m_cell_set(self,value.this)
return
self.__dict__[name] = value
def __getattr__(self,name):
if name == "m_row" :
return windows2c.wxGridEvent_m_row_get(self)
if name == "m_col" :
return windows2c.wxGridEvent_m_col_get(self)
if name == "m_x" :
return windows2c.wxGridEvent_m_x_get(self)
if name == "m_y" :
return windows2c.wxGridEvent_m_y_get(self)
if name == "m_control" :
return windows2c.wxGridEvent_m_control_get(self)
if name == "m_shift" :
return windows2c.wxGridEvent_m_shift_get(self)
if name == "m_cell" :
return wxGridCellPtr(windows2c.wxGridEvent_m_cell_get(self))
raise AttributeError,name
def __repr__(self):
return "<C wxGridEvent instance at %s>" % (self.this,)
class wxGridEvent(wxGridEventPtr):
def __init__(self,this):
self.this = this
class wxNotebookEventPtr(wxNotifyEventPtr):
def __init__(self,this):
self.this = this
@ -586,15 +214,3 @@ class wxSplitterWindow(wxSplitterWindowPtr):
#-------------- VARIABLE WRAPPERS ------------------
wxGRID_TEXT_CTRL = windows2c.wxGRID_TEXT_CTRL
wxGRID_HSCROLL = windows2c.wxGRID_HSCROLL
wxGRID_VSCROLL = windows2c.wxGRID_VSCROLL
wxEVT_GRID_SELECT_CELL = windows2c.wxEVT_GRID_SELECT_CELL
wxEVT_GRID_CREATE_CELL = windows2c.wxEVT_GRID_CREATE_CELL
wxEVT_GRID_CHANGE_LABELS = windows2c.wxEVT_GRID_CHANGE_LABELS
wxEVT_GRID_CHANGE_SEL_LABEL = windows2c.wxEVT_GRID_CHANGE_SEL_LABEL
wxEVT_GRID_CELL_CHANGE = windows2c.wxEVT_GRID_CELL_CHANGE
wxEVT_GRID_CELL_LCLICK = windows2c.wxEVT_GRID_CELL_LCLICK
wxEVT_GRID_CELL_RCLICK = windows2c.wxEVT_GRID_CELL_RCLICK
wxEVT_GRID_LABEL_LCLICK = windows2c.wxEVT_GRID_LABEL_LCLICK
wxEVT_GRID_LABEL_RCLICK = windows2c.wxEVT_GRID_LABEL_RCLICK

View File

@ -1771,7 +1771,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxNotifyEvent","_class_wxNotifyEvent",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
{ "_wxGrid","_class_wxGrid",0},
{ "_wxPen","_class_wxPen",0},
{ "_wxUpdateUIEvent","_class_wxUpdateUIEvent",0},
{ "_byte","_unsigned_char",0},
@ -1821,7 +1820,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxMask","_wxMask",0},
{ "_wxTextDataObject","_class_wxTextDataObject",0},
{ "_class_wxKeyEvent","_wxKeyEvent",0},
{ "_class_wxGrid","_wxGrid",0},
{ "_wxColour","_class_wxColour",0},
{ "_class_wxDialog","_wxDialog",0},
{ "_class_wxFileDataObject","_wxFileDataObject",0},
@ -1856,7 +1854,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxEvent","_wxEvent",0},
{ "_wxCheckListBox","_class_wxCheckListBox",0},
{ "_wxSplitterEvent","_class_wxSplitterEvent",0},
{ "_wxGridEvent","_class_wxGridEvent",0},
{ "_wxRect","_class_wxRect",0},
{ "_wxCommandEvent","_class_wxSashEvent",SwigwxSashEventTowxCommandEvent},
{ "_wxCommandEvent","_wxSashEvent",SwigwxSashEventTowxCommandEvent},
@ -1960,7 +1957,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
{ "_class_wxRadioBox","_wxRadioBox",0},
{ "_wxGridCell","_class_wxGridCell",0},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_wxMemoryDC","_class_wxMemoryDC",0},
@ -2070,14 +2066,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_class_wxSashEvent",SwigwxSashEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxSashEvent",SwigwxSashEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxGridCell","_wxGridCell",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_wxBitmap",0},
{ "_class_wxMemoryDC","_wxMemoryDC",0},

View File

@ -615,7 +615,7 @@ PyObject *ptrfree(PyObject *_PTRVALUE) {
void wxApp_CleanUp() {
wxApp::CleanUp();
__wxCleanup();
}
extern "C" SWIGEXPORT(void) initwindowsc();
@ -1613,7 +1613,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxTreeCtrl","_wxTreeCtrl",0},
{ "_wxMask","_class_wxMask",0},
{ "_wxToolTip","_class_wxToolTip",0},
{ "_wxGrid","_class_wxGrid",0},
{ "_wxPNGHandler","_class_wxPNGHandler",0},
{ "_class_wxColourData","_wxColourData",0},
{ "_class_wxPageSetupDialogData","_wxPageSetupDialogData",0},
@ -1680,7 +1679,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxTextDataObject","_class_wxTextDataObject",0},
{ "_class_wxKeyEvent","_wxKeyEvent",0},
{ "_class_wxToolTip","_wxToolTip",0},
{ "_class_wxGrid","_wxGrid",0},
{ "_class_wxPNGHandler","_wxPNGHandler",0},
{ "_wxColour","_class_wxColour",0},
{ "_class_wxDialog","_wxDialog",0},
@ -1713,7 +1711,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxEvent","_wxEvent",0},
{ "_wxCheckListBox","_class_wxCheckListBox",0},
{ "_wxSplitterEvent","_class_wxSplitterEvent",0},
{ "_wxGridEvent","_class_wxGridEvent",0},
{ "_wxRect","_class_wxRect",0},
{ "_wxCommandEvent","_class_wxCommandEvent",0},
{ "_wxSizeEvent","_class_wxSizeEvent",0},
@ -1833,7 +1830,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
{ "_class_wxRadioBox","_wxRadioBox",0},
{ "_wxGridCell","_class_wxGridCell",0},
{ "_class_wxBoxSizer","_wxBoxSizer",0},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
@ -1965,13 +1961,11 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxGridCell","_wxGridCell",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_wxBitmap",0},
{ "_class_wxMemoryDC","_wxMemoryDC",0},
@ -2059,6 +2053,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxDEFAULT_DIALOG_STYLE", PyInt_FromLong((long) wxDEFAULT_DIALOG_STYLE));
PyDict_SetItemString(d,"wxFRAME_TOOL_WINDOW", PyInt_FromLong((long) wxFRAME_TOOL_WINDOW));
PyDict_SetItemString(d,"wxFRAME_FLOAT_ON_PARENT", PyInt_FromLong((long) wxFRAME_FLOAT_ON_PARENT));
PyDict_SetItemString(d,"wxFRAME_NO_WINDOW_MENU", PyInt_FromLong((long) wxFRAME_NO_WINDOW_MENU));
PyDict_SetItemString(d,"wxED_CLIENT_MARGIN", PyInt_FromLong((long) wxED_CLIENT_MARGIN));
PyDict_SetItemString(d,"wxED_BUTTONS_BOTTOM", PyInt_FromLong((long) wxED_BUTTONS_BOTTOM));
PyDict_SetItemString(d,"wxED_BUTTONS_RIGHT", PyInt_FromLong((long) wxED_BUTTONS_RIGHT));
@ -2244,6 +2239,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxID_YES", PyInt_FromLong((long) wxID_YES));
PyDict_SetItemString(d,"wxID_NO", PyInt_FromLong((long) wxID_NO));
PyDict_SetItemString(d,"wxID_STATIC", PyInt_FromLong((long) wxID_STATIC));
PyDict_SetItemString(d,"wxID_SEPARATOR", PyInt_FromLong((long) wxID_SEPARATOR));
PyDict_SetItemString(d,"wxBITMAP_TYPE_BMP", PyInt_FromLong((long) wxBITMAP_TYPE_BMP));
PyDict_SetItemString(d,"wxBITMAP_TYPE_BMP_RESOURCE", PyInt_FromLong((long) wxBITMAP_TYPE_BMP_RESOURCE));
PyDict_SetItemString(d,"wxBITMAP_TYPE_ICO", PyInt_FromLong((long) wxBITMAP_TYPE_ICO));

View File

@ -181,6 +181,7 @@ wxDEFAULT_FRAME_STYLE = wxc.wxDEFAULT_FRAME_STYLE
wxDEFAULT_DIALOG_STYLE = wxc.wxDEFAULT_DIALOG_STYLE
wxFRAME_TOOL_WINDOW = wxc.wxFRAME_TOOL_WINDOW
wxFRAME_FLOAT_ON_PARENT = wxc.wxFRAME_FLOAT_ON_PARENT
wxFRAME_NO_WINDOW_MENU = wxc.wxFRAME_NO_WINDOW_MENU
wxED_CLIENT_MARGIN = wxc.wxED_CLIENT_MARGIN
wxED_BUTTONS_BOTTOM = wxc.wxED_BUTTONS_BOTTOM
wxED_BUTTONS_RIGHT = wxc.wxED_BUTTONS_RIGHT
@ -366,6 +367,7 @@ wxID_APPLY = wxc.wxID_APPLY
wxID_YES = wxc.wxID_YES
wxID_NO = wxc.wxID_NO
wxID_STATIC = wxc.wxID_STATIC
wxID_SEPARATOR = wxc.wxID_SEPARATOR
wxBITMAP_TYPE_BMP = wxc.wxBITMAP_TYPE_BMP
wxBITMAP_TYPE_BMP_RESOURCE = wxc.wxBITMAP_TYPE_BMP_RESOURCE
wxBITMAP_TYPE_ICO = wxc.wxBITMAP_TYPE_ICO

View File

@ -32,6 +32,9 @@
//#include <gdk/gdk.h>
//#include <gdk/gdkx.h>
//#include <gtk/gtkwindow.h>
extern GtkWidget *wxRootWindow;
#endif
@ -84,43 +87,28 @@ bool wxPyApp::OnInit(void) {
}
int wxPyApp::MainLoop(void) {
int retval = wxApp::MainLoop();
//# AfterMainLoop();
wxPythonApp->OnExit(); //#
int retval = 0;
DeletePendingObjects();
#ifdef __WXGTK__
m_initialized = wxTopLevelWindows.GetCount() != 0;
#endif
if (Initialized()) {
retval = wxApp::MainLoop();
wxPythonApp->OnExit();
}
return retval;
}
//# void wxPyApp::AfterMainLoop(void) {
// // more stuff from wxEntry...
// if (wxPythonApp->GetTopWindow()) {
// // Forcibly delete the window.
// if (wxPythonApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame)) ||
// wxPythonApp->GetTopWindow()->IsKindOf(CLASSINFO(wxDialog))) {
// wxPythonApp->GetTopWindow()->Close(TRUE);
// wxPythonApp->DeletePendingObjects();
// }
// else {
// delete wxPythonApp->GetTopWindow();
// wxPythonApp->SetTopWindow(NULL);
// }
// }
// #ifdef __WXGTK__
// wxPythonApp->DeletePendingObjects();
// #endif
// wxPythonApp->OnExit();
// wxApp::CleanUp();
// // delete wxPythonApp;
// }
//---------------------------------------------------------------------
// a few native methods to add to the module
//----------------------------------------------------------------------
int wxEntryStart( int argc, char *argv[] );
int wxEntryInitGui();
void wxEntryCleanup();
// This is where we pick up the first part of the wxEntry functionality...
// The rest is in __wxStart and AfterMainLoop. This function is called when
@ -137,6 +125,8 @@ void __wxPreStart()
if (wxTopLevelWindows.Number() > 0)
return;
#if 0
#ifdef __WXMSW__
wxApp::Initialize();
#endif
@ -150,22 +140,54 @@ void __wxPreStart()
argv[x] = PyString_AsString(PyList_GetItem(sysargv, x));
argv[argc] = NULL;
#if wxUSE_THREADS
/* GTK 1.2 up to version 1.2.3 has broken threads */
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 4))
{
printf( "wxWindows warning: GUI threading disabled due to outdated GTK version\n" );
}
else
{
g_thread_init(NULL);
}
#endif
gtk_set_locale();
#if wxUSE_WCHAR_T
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
#else
if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
#endif
gdk_threads_enter();
gtk_init( &argc, &argv );
wxSetDetectableAutoRepeat( TRUE );
delete [] argv;
wxApp::Initialize(); // may return FALSE. Should we check?
if (!wxApp::Initialize())
{
gdk_threads_leave();
}
#endif
#endif // 0
PyObject* sysargv = PySys_GetObject("argv");
int argc = PyList_Size(sysargv);
char** argv = new char*[argc+1];
int x;
for(x=0; x<argc; x++)
argv[x] = PyString_AsString(PyList_GetItem(sysargv, x));
argv[argc] = NULL;
wxEntryStart(argc, argv);
}
#ifdef WXP_WITH_THREAD
PyThreadState* wxPyEventThreadState = NULL;
#endif
@ -197,8 +219,8 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
// This is the next part of the wxEntry functionality...
wxPythonApp->argc = 0;
wxPythonApp->argv = NULL;
wxPythonApp->OnInitGui();
wxEntryInitGui();
// Call the Python App's OnInit function
arglist = PyTuple_New(0);
@ -218,14 +240,16 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
}
#ifdef __WXGTK__
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
wxTheApp->m_initialized = (wxTopLevelWindows.GetCount() > 0);
#endif
Py_INCREF(Py_None);
return Py_None;
}
void __wxCleanup() {
wxEntryCleanup();
}

View File

@ -60,6 +60,7 @@ extern wxPyApp *wxPythonApp;
void __wxPreStart();
PyObject* __wxStart(PyObject*, PyObject* args);
void __wxCleanup();
extern PyObject* wxPython_dict;
PyObject* __wxSetDictionary(PyObject*, PyObject* args);

View File

@ -108,7 +108,7 @@ public:
%inline %{
void wxApp_CleanUp() {
wxApp::CleanUp();
__wxCleanup();
}
%}