//------------------------------------------------------------------------------ int mforms::gtk::MenuImpl::add_separator(Menu *self) { int index = -1; MenuImpl* menu = self->get_data<MenuImpl>(); if (menu) { Gtk::SeparatorMenuItem *sep = Gtk::manage(new Gtk::SeparatorMenuItem()); menu->_menu.append(*sep); sep->show(); index = menu->_menu.items().size() - 1; } return index; }
void TableofcontentsNoteAddin::on_populate_popup (Gtk::Menu* popup_menu) //prepened a toc submenu in the contextual menu { Gtk::Menu *toc_menu = manage(new Gtk::Menu()); populate_toc_menu (toc_menu); Gtk::SeparatorMenuItem *separator = manage(new Gtk::SeparatorMenuItem ()); separator->show (); popup_menu->prepend (*separator); Gtk::ImageMenuItem *menu_item = new_toc_menu_item (); menu_item->set_submenu (*toc_menu); menu_item->show (); popup_menu->prepend (*menu_item); }