1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Helper functions/classes for the wxPython extenaion module
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __wxp_helpers__
14 #define __wxp_helpers__
19 //----------------------------------------------------------------------
21 class wxPyApp
: public wxApp
26 void AfterMainLoop(void);
29 extern wxPyApp
*wxPythonApp
;
31 //----------------------------------------------------------------------
34 PyObject
* __wxStart(PyObject
*, PyObject
* args
);
36 extern PyObject
* wxPython_dict
;
37 PyObject
* __wxSetDictionary(PyObject
*, PyObject
* args
);
39 extern wxHashTable
* wxPyWindows
; // keep track of all windows so we
40 // don't accidentally delete them twice.
42 void wxPyEventThunker(wxObject
*, wxEvent
& event
);
44 //----------------------------------------------------------------------
48 extern "C" void SWIG_MakePtr(char *, void *, char *);
49 extern "C" char *SWIG_GetPtr(char *, void **, char *);
54 # pragma warning(disable:4800)
57 typedef unsigned char byte
;
60 // Non-const versions to keep SWIG happy.
61 extern wxPoint wxPyDefaultPosition
;
62 extern wxSize wxPyDefaultSize
;
63 extern wxString wxPyEmptyStr
;
65 //----------------------------------------------------------------------
67 class wxPyCallback
: public wxObject
{
69 wxPyCallback(PyObject
* func
) { m_func
= func
; Py_INCREF(m_func
); }
70 ~wxPyCallback() { Py_DECREF(m_func
); }
72 void EventThunker(wxEvent
& event
);
77 //---------------------------------------------------------------------------
79 class wxPyMenu
: public wxMenu
{
81 wxPyMenu(const wxString
& title
= "", PyObject
* func
=NULL
);
85 static void MenuCallback(wxMenu
& menu
, wxCommandEvent
& evt
);
90 //---------------------------------------------------------------------------
92 class wxPyTimer
: public wxTimer
{
94 wxPyTimer(PyObject
* callback
);
103 //---------------------------------------------------------------------------
104 /////////////////////////////////////////////////////////////////////////////
107 // Revision 1.6 1998/11/25 08:45:26 RD
108 // Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon
109 // Added events for wxGrid
110 // Other various fixes and additions
112 // Revision 1.5 1998/10/02 06:40:40 RD
114 // Version 0.4 of wxPython for MSW.
116 // Revision 1.4 1998/08/27 21:59:09 RD
117 // Some chicken-and-egg problems solved for wxPython on wxGTK
119 // Revision 1.3 1998/08/16 04:31:09 RD
122 // Revision 1.2 1998/08/14 23:36:37 RD
123 // Beginings of wxGTK compatibility
125 // Revision 1.1 1998/08/09 08:25:51 RD