From 15d9a04c6877a2f730b679402e6798aaace16e3a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 18 Jul 2003 02:29:57 +0000 Subject: [PATCH 1/1] stop usign a deprecated method, and ensure that the imagelist ownership is trnasfered when using AssignImageList. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/gizmos/gizmos.i | 6 ++++++ wxPython/contrib/gizmos/gizmos.py | 3 +++ wxPython/contrib/gizmos/treelistctrl.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index e677f65e8c..ba673eba1d 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -553,9 +553,15 @@ public: void SetImageList(wxImageList *imageList); void SetStateImageList(wxImageList *imageList); void SetButtonsImageList(wxImageList *imageList); + void AssignImageList(wxImageList *imageList); + %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" + void AssignStateImageList(wxImageList *imageList); + %pragma(python) addtomethod = "AssignStateImageList:_args[0].thisown = 0" + void AssignButtonsImageList(wxImageList *imageList); + %pragma(python) addtomethod = "AssignButtonsImageList:_args[0].thisown = 0" diff --git a/wxPython/contrib/gizmos/gizmos.py b/wxPython/contrib/gizmos/gizmos.py index 9ad14b4827..bbd10067db 100644 --- a/wxPython/contrib/gizmos/gizmos.py +++ b/wxPython/contrib/gizmos/gizmos.py @@ -375,12 +375,15 @@ class wxTreeListCtrlPtr(wxControlPtr): return val def AssignImageList(self, *_args, **_kwargs): val = gizmosc.wxTreeListCtrl_AssignImageList(self, *_args, **_kwargs) + _args[0].thisown = 0 return val def AssignStateImageList(self, *_args, **_kwargs): val = gizmosc.wxTreeListCtrl_AssignStateImageList(self, *_args, **_kwargs) + _args[0].thisown = 0 return val def AssignButtonsImageList(self, *_args, **_kwargs): val = gizmosc.wxTreeListCtrl_AssignButtonsImageList(self, *_args, **_kwargs) + _args[0].thisown = 0 return val def AddColumn(self, *_args, **_kwargs): val = gizmosc.wxTreeListCtrl_AddColumn(self, *_args, **_kwargs) diff --git a/wxPython/contrib/gizmos/treelistctrl.cpp b/wxPython/contrib/gizmos/treelistctrl.cpp index a559d95415..b14bb3b961 100644 --- a/wxPython/contrib/gizmos/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/treelistctrl.cpp @@ -3540,7 +3540,7 @@ void wxTreeListMainWindow::OnChar( wxKeyEvent &event ) // right : open if parent and go next (or expand on Win32) // home : go to root // end : go to last item without opening parents - switch (event.KeyCode()) + switch (event.GetKeyCode()) { #ifndef __WXMSW__ // mimic the standard win32 tree ctrl case '+': -- 2.45.2