1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Gtk::Widget* PlotTest::Make_Menu(void)
{
m_refActionGroup = Gtk::ActionGroup::create();
//Choices menu, to demonstrate Radio items
m_refActionGroup->add( Gtk::Action::create("PortMenu", "Port") );
Portone = Gtk::RadioAction::create(group_userlevel1, "PortOne", "ttyS0");
m_refActionGroup->add(Portone, sigc::mem_fun(*this, &PlotTest::PortSelection) );
PortTwo = Gtk::RadioAction::create(group_userlevel1, "PortTwo", "ttyS1");
m_refActionGroup->add(PortTwo, sigc::mem_fun(*this, &PlotTest::PortSelection) );
m_refActionGroup->add( Gtk::Action::create("VitesseMenu", "Vitesse"));
VitesseOne = Gtk::RadioAction::create(group_userlevel2, "VitesseOne", "115200");
m_refActionGroup->add(VitesseOne, sigc::mem_fun(*this, &PlotTest::VitesseSelection) );
VitesseTwo = Gtk::RadioAction::create(group_userlevel2, "VitesseTwo", "X");
m_refActionGroup->add(VitesseTwo, sigc::mem_fun(*this, &PlotTest::VitesseSelection) );
m_refUIManager = Gtk::UIManager::create();
m_refUIManager->insert_action_group(m_refActionGroup);
m_refUIManager->add_ui_from_string(ui_info);
return m_refUIManager->get_widget("/MenuBar");
} |
Partager