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 //----------------------------------------------------------------------
33 PyObject
* __wxStart(PyObject
*, PyObject
* args
);
35 extern PyObject
* wxPython_dict
;
36 PyObject
* __wxSetDictionary(PyObject
*, PyObject
* args
);
38 extern wxHashTable
* wxPyWindows
; // keep track of all windows so we
39 // don't accidentally delete them twice.
41 void wxPyEventThunker(wxObject
*, wxEvent
& event
);
43 //----------------------------------------------------------------------
47 extern "C" void SWIG_MakePtr(char *, void *, char *);
48 extern "C" char *SWIG_GetPtr(char *, void **, char *);
53 # pragma warning(disable:4800)
57 // Non-const versions to keep SWIG happy.
58 extern wxPoint wxPyDefaultPosition
;
59 extern wxSize wxPyDefaultSize
;
60 extern char* wxPyPanelNameStr
;
61 extern wxString wxPyEmptyStr
;
63 //----------------------------------------------------------------------
65 class wxPyCallback
: public wxObject
{
67 wxPyCallback(PyObject
* func
) { m_func
= func
; Py_INCREF(m_func
); }
68 ~wxPyCallback() { Py_DECREF(m_func
); }
70 void EventThunker(wxEvent
& event
);
75 //---------------------------------------------------------------------------
77 class wxPyMenu
: public wxMenu
{
79 wxPyMenu(const wxString
& title
= "", PyObject
* func
=NULL
);
83 static void MenuCallback(wxMenu
& menu
, wxCommandEvent
& evt
);
87 //---------------------------------------------------------------------------
89 class wxPyTimer
: public wxTimer
{
91 wxPyTimer(PyObject
* callback
);
100 //---------------------------------------------------------------------------
101 /////////////////////////////////////////////////////////////////////////////
104 // Revision 1.1 1998/08/09 08:25:51 RD