A bit of code reoganization

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-12-07 03:17:10 +00:00
parent 80ddad4ab7
commit fcf745d0ca
3 changed files with 52 additions and 15 deletions

View File

@@ -237,19 +237,6 @@ logged in on the main display of your Mac."""
#----------------------------------------------------------------------------
# TODO: Move this someplace else?
def deprecated(func):
def new_func(*args, **kwargs):
import warnings
warnings.warn("Call to deprecated item %s." % func.__name__,
category=DeprecationWarning)
return func(*args, **kwargs)
new_func.__name__ = func.__name__
new_func.__doc__ = func.__doc__
new_func.__dict__.update(func.__dict__)
return new_func
@deprecated
class PySimpleApp(App):
"""

View File

@@ -1,7 +1,13 @@
# A little trick to make 'wx' be a reference to this module so wx.Names can
# be used in the python code here.
import sys as _sys
wx = _sys.modules[__name__]
# Load version numbers from __version__... Ensure that major and minor
# versions are the same for both wxPython and wxWidgets.
from __version__ import *
__version__ = VERSION_STRING
import _core
@@ -30,7 +36,21 @@ def version():
port = '???'
return "%s %s" % (wx.VERSION_STRING, port)
def deprecated(func):
def new_func(*args, **kwargs):
import warnings
warnings.warn("Call to deprecated item %s." % func.__name__,
category=DeprecationWarning)
return func(*args, **kwargs)
new_func.__name__ = func.__name__
new_func.__doc__ = func.__doc__
new_func.__dict__.update(func.__dict__)
return new_func
## #----------------------------------------------------------------------------
## class PyDeadObjectError(AttributeError):

30
src/window_ex.cpp Normal file
View File

@@ -0,0 +1,30 @@
#ifdef __WXMSW__
#include <wx/msw/private.h>
#endif
#ifdef __WXGTK__
#include <gdk/gdkx.h>
#include <wx/gtk/private/win_gtk.h>
#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
#endif
void* wxPyGetWinHandle(wxWindow* win)
{
#ifdef __WXMSW__
return (void*)win->GetHandle();
#endif
#if defined(__WXGTK__) || defined(__WXX11__)
return (void*)GetXWindow(win);
#endif
#ifdef __WXMAC__
return (void*)win->GetHandle();
#endif
return 0;
}