Endless error with python and Global menu

Asked by gbonline

Hi, i'm working with 2 distro of ubuntu : 12.04 lts and 13.04 with python (2.7.x) and wxpython on Unity, and both have the same error.
In my app the Wx Forms run well, but if the app have a menu when I close the app Form i get the error:

(python:25025): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

and looking for it on google i've found that if i remove the ubuntu global menu the error goes away.
Ok well done: sudo apt-get remove appmenu.....................
Restart the app and ....
one new error! when i use the app menu i get in terminal

python: undefined symbol: menu_proxy_module_load
(python:24841): Gtk-WARNING **: Failed to load type module: (null)

and googling for a solution : reinstall the ubuntu global menu !!!!

And now what can i do?

I've made a demo app that have this error, try it:

    # -*- coding: utf-8 -*-

    import wx
    import wx.xrc

    class MyFrame3 ( wx.Frame ):

       def __init__( self, parent ):
          wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Test menu", pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

          self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

          self.m_menubar3 = wx.MenuBar( 0 )
          self.m_menu4 = wx.Menu()
          self.m_menuItem9 = wx.MenuItem( self.m_menu4, wx.ID_ANY, u"Test voce", wx.EmptyString, wx.ITEM_NORMAL )
          self.m_menu4.AppendItem( self.m_menuItem9 )

          self.m_menubar3.Append( self.m_menu4, u"Test" )

          self.SetMenuBar( self.m_menubar3 )

          self.Centre( wx.BOTH )

       def __del__( self ):
          pass

    class MainFrame( MyFrame3 ):
       def __init__( self, parent ):
          MyFrame3.__init__( self, parent )

    class TestMenu(wx.App):
        def OnInit(self):
            self.m_frame = MainFrame(None)
            self.m_frame.Show()
            self.SetTopWindow(self.m_frame)
            return True

    app = TestMenu(0)
    app.MainLoop()

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask gbonline for more information if necessary.

To post a message you must log in.