Hi list, I want to add standalone menuitems and remove them one by one
later if needed. I want to use the add_ui function, but I cant translate my
xml to match the add_ui's function parameters.

Here is my code snippet:

this->m_refActionGroup->add(Gtk::Action::create("TestMenu", "Test"));
this->m_refActionGroup->add(Gtk::Action::create("TestMenuEntry",
Gtk::Stock::NEW, "Test"));
this->id = this->m_refUIManager->add_ui_from_string(
    "<ui>"
    " <menubar name='MenuBar'>"
    " <menu action='TestMenu'>"
    " <menuitem action='TestMenuEntry' />"
    " </menu>"
    " </menubar>"
    "</ui>");

It works, but when I switch to add_ui function, it doesn't happen anything.

this->id = this->m_refUIManager->new_merge_id();
this->m_refUIManager->add_ui(this->id, "/ui/MenuBar", "TestMenu",
"TestMenuEntry");

I can't find any good tutorial or documentation, so somebody could help me?
Thanks.
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to