diff --git a/CHANGES.rst b/CHANGES.rst index 91847393..65276bec 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -40,6 +40,7 @@ Changes in this release include the following: * Add methods to wx.TextCtrl for output "file-like" compatibility. (#578) +* Fix object ownership issue for menus added to toolbar items. (#580) diff --git a/etg/toolbar.py b/etg/toolbar.py index 3337fcea..f3c872b7 100644 --- a/etg/toolbar.py +++ b/etg/toolbar.py @@ -65,6 +65,7 @@ def run(): gcd.type = 'wxPyUserData*' gcd.setCppCode('return dynamic_cast(self->GetClientData());') + c.find('SetDropdownMenu.menu').transfer = True #--------------------------------------------- @@ -96,6 +97,8 @@ def run(): c.find('OnRightClick').ignore() c.find('OnLeftClick').ignore() + c.find('SetDropdownMenu.menu').transfer = True + # Add some deprecated methods to aid with Classic compatibility. # TODO: Which others are commonly enough used that they should be here too?