I had this problem trying to implement a message in a status bar when the user moves
his/her mouse over the menu item (yeah, I reimplemented something from libgnomeuimm... oh
well), but I found a solution that I've adapted to your problem:
1. Make some pointers to Gtk::CheckMenuItem (the number depends on how many
CheckMenuElems you have and/or how many you want to access. For our example, we'll use
m_abc, m_def, and m_ghi (remember, this is in your class):
Gtk::CheckMenuItem *m_abc, *m_def, *m_ghi;
2. After push_back'ing the CheckMenuElems into the menu, assign one of your pointers the
address (I think) of the back method of menulist. Here's an example using your code:
ClassTest::ClassTest() : somelabel("fred") {
/* Construct the popup menu */
Menu::MenuList &menulist = popup.items();
menulist.push_back(Menu_Helpers::CheckMenuElem("abc",
SigC::slot(*this, &ClassTest::ChangeLabel)));
m_abc = &menulist.back();
menulist.push_back(Menu_Helpers::CheckMenuElem("def",
SigC::slot(*this, &ClassTest::ChangeLabel)));
m_def = &menulist.back();
menulist.push_back(Menu_Helpers::CheckMenuElem("ghi",
SigC::slot(*this, &ClassTest::ChangeLabel)));
m_ghi = &menulist.back();
/* ... could be any number of elements added ... */
popup.accelerate(*this);
...
3. Now access the check menu items by dereferencing them (->)
m_abc->toggled();
Disclaimer: I've only used this to check if the menu item (Gtk::MenuItem) has the mouse
over it, so this should work (given my limited experience) with Gtk::CheckMenuItem. I
hope this helps. If I'm wrong, someone please correct me :).
-Bryan