X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/194fa2aca06cba3b619eb346df4013c092e4cba1..c92b0f9abd8348df6c43e69e66cc428fb9aac59c:/utils/wxPython/src/helpers.cpp diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp index 685a999c25..a512d7c07c 100644 --- a/utils/wxPython/src/helpers.cpp +++ b/utils/wxPython/src/helpers.cpp @@ -27,6 +27,11 @@ #ifdef __WXGTK__ #include +#include +#include +//#include +//#include +//#include #endif @@ -575,6 +580,25 @@ PyObject* wxPy_ConvertList(wxListBase* list, const char* className) { return pyList; } +//---------------------------------------------------------------------- + +long wxPyGetWinHandle(wxWindow* win) { +#ifdef __WXMSW__ + return (long)win->GetHandle(); +#endif + + // Find and return the actual X-Window. +#ifdef __WXGTK__ + if (win->m_wxwindow) { + GdkWindowPrivate* bwin = (GdkWindowPrivate*)GTK_PIZZA(win->m_wxwindow)->bin_window; + if (bwin) { + return (long)bwin->xwindow; + } + } +#endif + return 0; +} + //---------------------------------------------------------------------- // Some helper functions for typemaps in my_typemaps.i, so they won't be // included in every file...