[gtkmm] bug in the published documentation



I check the file menu_elems.h, I cannot find the constuctor described in
the documentation:

Gtk::Menu_Helpers::StockMenuElem::StockMenuElem(const Gtk::StockID&
stock_id, Gtk::Menu& submenu);

It seems that it is not declared in the header file.

----------------------------------------

//Help menu: (exercise stock items)
{
    Gtk::Menu::MenuList& menulist = m_Menu_Help.items();
    menulist.push_back( Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-cdrom"),
			SigC::slot(*this, &ExampleWindow::on_menu_others) ) );
}

//Add the menus to the MenuBar:
m_MenuBar.items().push_back( Gtk::Menu_Helpers::StockMenuElem::StockMenuElem(Gtk::StockID("gtk-help"), m_Menu_Help) );

----------------------------------------

The above is a piece of code from the sample code in Menu section. When I
compile it, I got the folloing error message:

g++ -g menu.cc -o menu `pkg-config gtkmm-2.0 --libs --cflags`
menu.cc: In method `ExampleWindow::ExampleWindow()':
menu.cc:72: no matching function for call to `Gtk::Menu_Helpers::StockMenuElem::StockMenuElem (Gtk::StockID, Gtk::Menu &)'
/usr/include/gtkmm-2.0/gtkmm/menu_elems.h:166: candidates are:
Gtk::Menu_Helpers::StockMenuElem::StockMenuElem(const Gtk::StockID &, const SigC::Slot0<void> & = Slot0<void>())
/usr/include/gtkmm-2.0/gtkmm/menu_elems.h:175:
Gtk::Menu_Helpers::StockMenuElem::StockMenuElem(const Gtk::StockID &, const Gtk::Menu_Helpers::AccelKey &, const SigC::Slot0<void> & = Slot0<void>())
/usr/include/gtkmm-2.0/gtkmm/menu_elems.h:176:
Gtk::Menu_Helpers::StockMenuElem::StockMenuElem(const Gtk::Menu_Helpers::StockMenuElem &)

Compilation exited abnormally with code 1 at Tue Nov 26 10:33:19






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]