X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76b8fa1d2077661a6710f532eb141468ab36c1c8..9ac884500ce30c58e24b0a6af1288b576d2e03e4:/wxPython/src/_listctrl.i?ds=inline diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index a982f7154b..af9def88fa 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -174,7 +174,7 @@ public: void AssignFrom(const wxListItemAttr& source); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); @@ -192,9 +192,15 @@ public: // wxListItem: the item or column info, used to exchange data with wxListCtrl class wxListItem : public wxObject { public: + // turn off this typemap + %typemap(out) wxListItem*; + wxListItem(); ~wxListItem(); + // Turn it back on again + %typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); } + // resetting void Clear(); void ClearAttributes(); @@ -446,13 +452,17 @@ IMP_PYCALLBACK_INT_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemColumnImage); - +// NOTE: The following option is set in _settings.i +// # Until the new native control for wxMac is up to par, still use the generic one. +// SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1) MustHaveApp(wxPyListCtrl); %rename(ListCtrl) wxPyListCtrl; class wxPyListCtrl : public wxControl { public: + // turn off this typemap + %typemap(out) wxPyListCtrl*; %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)" %pythonAppend wxPyListCtrl() "" @@ -465,6 +475,9 @@ public: const wxString& name = wxPyListCtrlNameStr); %RenameCtor(PreListCtrl, wxPyListCtrl()); + // Turn it back on again + %typemap(out) wxPyListCtrl* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -835,7 +848,7 @@ any.", "", %extend { wxWindow* GetMainWindow() { - #ifdef __WXMSW__ + #if defined(__WXMSW__) || defined(__WXMAC__) return self; #else return (wxWindow*)self->m_mainWin;