Re: [gtkmm] Question to removal of MenuItems
- From: "Andreas B. Thun" <abt gmx de>
- To: Diana Esch-Mosher <desch-mosher lanl gov>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] Question to removal of MenuItems
- Date: Thu, 12 Feb 2004 14:59:54 +0100
Thx, Diana for your posting.
I still havenīt found a way to remove an item
from MenuList:
void TopMenuBar::removeDataBaseMenu(const int& itemNr)
{
MenuList& ml = m_dataBase_menu->items();
int i = 0;
MenuList::iterator itr_ml;
for (itr_ml = ml.begin(); itr_ml != ml.end(); ++itr_ml) {
if (i == itemNr)
*itr_ml.remove(); // there is no remove or erase. How can I remove the item?
i++;
}
glTabCnt--;
} // removeDataBaseMenu()
menulist = menu->get_items() is a standard iterator and you can
erase/clear items! Depending on the application it can be easier to
clear() and rebuild .... but often insert/erase are fine! You can even
menu->reorder_child(...) and if you want to just change text of an
element then do the following:
Gtk::Label *myLabel =
dynamic_cast<Gtk::Label*>(menulist[j].get_child());
myLabel->set_text("new text");
Diana Esch-Mosher
On Wed, 2004-02-11 at 05:04, Andreas B. Thun wrote:
Hi!
Is there a possibility to remove an existing
MenuItem or must I rebuild the whole Menu?
Thx in advance,
Andi
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]