9 #ifndef WXINTL_NO_GETTEXT_MACRO 10 #define WXINTL_NO_GETTEXT_MACRO 11 #endif // WXINTL_NO_GETTEXT_MACRO 18 #include <pybind11/operators.h> 20 #include <wxPython/wxpy_api.h> 48 wxPyBlock_t blocked = wxPyBeginBlockThreads();
49 wxString typeName(src->GetClassInfo()->GetClassName());
50 PyObject* obj = wxPyConstructObject(src, typeName,
false);
52 wxPyEndBlockThreads(blocked);
54 wxASSERT(obj !=
nullptr);
66 T*
wxLoad(pybind11::handle src,
const wxString& inTypeName)
69 PyObject *source = src.ptr();
73 bool success = wxPyConvertWrappedPtr(source, (
void**) &obj, inTypeName);
74 wxASSERT_MSG(success, _T(
"Returned object was not a ") + inTypeName);
80 void API_Py::wxAccess::SetModule(py::module &inModule)
82 py::object py_wxModule = py::module::import(
"wx");
83 py::module m_sub = inModule.def_submodule(
"wx",
"Access to the wxWidgets gui.");
85 m_sub.doc() = R
"pbdoc( 87 ----------------------- 89 .. currentmodule:: wxcpp_py.wx 103 m_sub.def("get_menu_bar", [] ()
107 }, py::return_value_policy::reference,
"Return the menu bar.");
109 m_sub.def(
"get_tool_bar", [] ()
113 }, py::return_value_policy::reference,
"Return the aui tool bar.");
115 m_sub.def(
"get_bottom", [] ()
119 }, py::return_value_policy::reference,
"Return the bottom aui note book.");
121 m_sub.def(
"get_left", [] ()
125 }, py::return_value_policy::reference,
"Return the left aui note book.");
127 m_sub.def(
"get_center", [] ()
131 }, py::return_value_policy::reference,
"Return the center aui note book.");
133 m_sub.def(
"get_mother_frame", [] ()
137 }, py::return_value_policy::reference,
"Return the mother frame.");
pybind11::handle wxCast(T *src)
Permet de construire l'objet de wxPython qui enrobera l'objet de wxWidget. Cette fonction est à utili...
T * wxLoad(pybind11::handle src, const wxString &inTypeName)
Permet de récupérer l'objet wxWidget enrobé par wxPython.