I am wondering if there is an easy way to change the label of a menu entry dynamically. Let’s say I have an entry “Save”. Depending on the tab the user is in, I want it to read “Save X” or “Save Y”, just to give the user some information on what will happen… Therefore I am looking for a method TGMenuEntry::SetLabel(TGHotString* s), in analogy to GetLabel(). But there is no such thing. I can work around it by deleting the menu entry and adding it with a different label, but that seems rather clumsy (specially if you have to locate the separator before the entry…).
Thanks for the information! I can manage with DeleteEntry/AddEntry. But I am really having trouble doing this when the entry is before a Separator. In TGPopupMenu::GetEntry(Int_t id) I read the following:
Could somebody perhaps provide a working example of this? How exactly do I “check the type” of the list item to extract the pointer to the separator such that I can give it to AddEntry() as the “before” argument?