Phoenix MenuItemWithBitmap Crash On AppExit

Sorry if I nabble duplicated this old post maybe get some attention now on google groups…

using

Python 2.7.4
wxPython 2.9.5.81-r73848

I have been trying for some time to figure out why my app keeps crashing when exiting…

Well, I have an answer.

A while back I was looking for some code to place a bmp on a submenu

I snaked that bit of code from the wxPythonDemo and modded it for AUINotebook split functions.

It is the same as the Demo>Catagory menus in the wxPythonDemo.

Anyway… Is there a proper way to do this in phoenix, or is this some small oversight, or are menus with bitmaps not supported?

Thanks in advance.

Here is the my menu code. I am using a wrapper function for standard menuitems, just in case you think it looks a bit funny.

menuitemwithbmp = wx.MenuItem(menu, wx.ID_ANY, _(u'Split Page'))
submenu = wx.Menu(style=wx.MENU_TEAROFF)
mi1 = menuItem(menu, ID_NOTEBOOK_SPLITPAGETOP, _(u'&Split Page Top'), _(u' Splits document view to the top'), n, None, gImgIdx['splitpagetop16.png'])
mi2 = menuItem(menu, ID_NOTEBOOK_SPLITPAGEBOTTOM, _(u'&Split Page Bottom'), _(u' Splits document view to the bottom'), n, None, gImgIdx['splitpagebottom16.png'])
mi3 = menuItem(menu, ID_NOTEBOOK_SPLITPAGELEFT, _(u'&Split Page Left'), _(u' Splits document view to the left'), n, None, gImgIdx['splitpageleft16.png'])
mi4 = menuItem(menu, ID_NOTEBOOK_SPLITPAGERIGHT, _(u'&Split Page Right'), _(u' Splits document view to the right'), n, None, gImgIdx['splitpageright16.png'])
submenu.Append(ID_NOTEBOOK_SPLITPAGETOP, _(u'&Split Page Top'))
submenu.Append(ID_NOTEBOOK_SPLITPAGEBOTTOM, _(u'&Split Page Bottom'))
submenu.Append(ID_NOTEBOOK_SPLITPAGELEFT, _(u'&Split Page Left'))
submenu.Append(ID_NOTEBOOK_SPLITPAGERIGHT, _(u'&Split Page Right'))
menuitemwithbmp.SetBitmap(gImgIdx['axe16.png'])
menuitemwithbmp.SetSubMenu(submenu)
menu.AppendItem(menuitemwithbmp)

Metallicow wrote:

Sorry if I nabble duplicated this old post maybe get some attention now
on google groups...

using
Python 2.7.4
wxPython 2.9.5.81-r73848

I have been trying for some time to figure out why my app keeps crashing
when exiting...
Well, I have an answer.

A while back I was looking for some code to place a bmp on a submenu
I snaked that bit of code from the wxPythonDemo and modded it for
AUINotebook split functions.
It is the same as the Demo>Catagory menus in the wxPythonDemo.

Anyway... Is there a proper way to do this in phoenix, or is this some
small oversight, or are menus with bitmaps not supported?
Thanks in advance.

It is a bug. Ownership of the submenu is not being transferred correctly. I'll commit a fix for that as soon as I can get caught up.

···

--
Robin Dunn
Software Craftsman