LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that d

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
wx_n00b
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Sep 05, 2013 12:07 am

LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that d

Post by wx_n00b »

Hi, this is the code that I put together following a tutorial (I compiled wxWidgets 2.8.12 today.)

Code: Select all

// hello_world.cpp:

#include "wx/wx.h"

class MyApp : public wxApp
{
public:
  virtual bool OnInit();
};

class MyFrame : public wxFrame
{
public:
  MyFrame(const wxString & title, const wxPoint & pos, const wxSize & size);

  void OnQuit(wxCommandEvent & event);
  void OnAbout(wxCommandEvent & event);

  DECLARE_EVENT_TABLE();
};

enum
{
  ID_Quit = 1,
  ID_About,
};

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
  EVT_MENU(ID_Quit, MyFrame::OnQuit)
  EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
  MyFrame * frame = new MyFrame( _("Hello world."), wxPoint(50, 50),
    wxSize(450, 340));
  frame -> Show(true);
  SetTopWindow(frame);
  return true;
}

MyFrame::MyFrame(const wxString & title, const wxPoint & pos,
    const wxSize & size)
  : wxFrame(NULL, -1, title, pos, size)
{
  wxMenu * menuFile = new wxMenu;

  menuFile -> Append(ID_About, _("&About..."));
  menuFile -> AppendSeparator();
  menuFile -> Append(ID_Quit, _("E&xit..."));

  wxMenuBar * menuBar = new wxMenuBar;
  menuBar -> Append(menuFile, _("&File..."));

  SetMenuBar(menuBar);

  CreateStatusBar();
  SetStatusText(_("Welcome to wxWidgets!"));
}

void MyFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
  Close(true);
}

void MyFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
  wxMessageBox(_("This is a wxWidgets Hello world sample"),
    _("About Hello World"), wxOK | wxICON_INFORMATION, this);
}
When I compile this code and then run it, everything appears to be fine. However, when I exit out of the app, I get this error:

Code: Select all

(hworld:27851): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're its parent.
After looking online, I found this ticket.
http://trac.wxwidgets.org/ticket/14292

I went into the source directory and then made the modifications specified in the ticket, but that did not work. Should I just drop 2.8 and move to 2.9? Thoughts on this issue?
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child th

Post by tierra »

You should update to wxWidgets 2.9.5 if you honestly care about this, but it is just a warning in your case, and as long as it's not affecting your application in any way (and it sounds like it's not), there's nothing wrong with ignoring it.
wx_n00b
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Sep 05, 2013 12:07 am

Re: LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child th

Post by wx_n00b »

tierra wrote:You should update to wxWidgets 2.9.5 if you honestly care about this, but it is just a warning in your case, and as long as it's not affecting your application in any way (and it sounds like it's not), there's nothing wrong with ignoring it.
I think I'll stick around with 2.8 for now.

By the way, I'm currently reading this book on wxWidgets in order to learn:
http://www.amazon.com/Cross-Platform-Pr ... =wxwidgets

Would you recommend any other sources of information?
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child th

Post by tierra »

That book, and the official manual should definitely be your first authoritative sources of info, but there's also a wealth of tutorials, guides, and snippets on the wiki as well as on the forums here.
Post Reply