Menu Implementation problem
- From: "MERT TUGCU" <merttugcu hotmail com>
- To: gtkmm-list gnome org
- Subject: Menu Implementation problem
- Date: Tue, 25 Apr 2006 16:59:09 -0500
Dear All,
I have a program, which has a menu implementation. It works fine except when
I quit, I get several warnings and sometimes segmentation fault. It seems
that the menu objects are not destroyed properly. Would you please let me
know, what I am doing wrong here? Thanks.
Here is my menu implementation:
//Fill main menu bar
menuBar.items().push_back(Gtk::Menu_Helpers::MenuElem("File",fileMenu));
menuBar.items().push_back(Gtk::Menu_Helpers::MenuElem("Memory",memoryMenu));
//File menu:
{
Gtk::Menu::MenuList& menulist = fileMenu.items();
menulist.push_back( Gtk::Menu_Helpers::MenuElem("Load",
trainingData_submenu) ); //Add submenu.
menulist.push_back( Gtk::Menu_Helpers::MenuElem("Save Training Data", \
sigc::mem_fun(*this, &InterfaceWindow::on_menu_saveTree) ) );
menulist.push_back( Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::QUIT, \
sigc::mem_fun(*this, &InterfaceWindow::on_menu_quit) ) );
}
//Memory menu:
{
Gtk::Menu::MenuList& menulist = memoryMenu.items();
menulist.push_back( Gtk::Menu_Helpers::MenuElem("Clear", \
sigc::mem_fun(*this, &InterfaceWindow::on_menu_clear) ) );
}
//File|Load Submenu:
{
Gtk::Menu::MenuList& menulist = trainingData_submenu.items();
menulist.push_back( Gtk::Menu_Helpers::MenuElem("Training Data",
fileMenu_Load_submenu) ); /Add submenu.
menulist.push_back( Gtk::Menu_Helpers::MenuElem("WM Network
Weights",sigc::mem_fun(*this, InterfaceWindow::on_menu_load_WM_Network) ) );
}
//File|Load|Training Data Submenu:
{
Gtk::Menu::MenuList& menulist = fileMenu_Load_submenu.items();
menulist.push_back( Gtk::Menu_Helpers::MenuElem("All(default)", \
sigc::mem_fun(*this, &InterfaceWindow::on_menu_loadDefault) ) );
menulist.push_back( Gtk::Menu_Helpers::MenuElem("From file", \
sigc::mem_fun(*this, &InterfaceWindow::on_menu_loadFromFile) ) );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]