Re: Removing a TGPopMenu or a TGMenuEntry (Was: Re: [ROOT] Dynamic TGPopupMenu/TGMenubar?)

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Sun Nov 18 2001 - 19:08:21 MET


Hi Brett,

   now in CVS new methods to allow menu's to be changed after 
initial creation:
in TGPopupMenu:
void            HideEntry(Int_t id);
Bool_t          IsEntryHidden(Int_t id);
void            DeleteEntry(Int_t id);
void            DeleteEntry(TGMenuEntry *entry);
TGMenuEntry    *GetEntry(Int_t id);
TGMenuEntry    *GetEntry(const char *s);
const TList    *GetListOfEntries() const;
in addition the AddXXXX() methods now accept a before item which allows the
addition of new menu items before the specified item.

In TGMenuBar:
TGPopupMenu *GetPopup(const char *s);
TGPopupMenu *RemovePopup(const char *s);
in addition the AddPopup() methods now accept a before item which allows the
addition of a new menu before the specified menu.

See the guitest programs on how these new methods should be used.


Cheers, Fons.



On Monday 12 November 2001 17:54, Brett Viren wrote:
> Hi again,
>
> I am worried that I was not clear enough about my question.  What I
> want to be able to do is to periodically either fully rebuild or
> modify "in place" a TGPopupMenu which is attatched to a TGMenuBar.
>
> To modify a TGPopupMenu by deleting and rebuilding from scratch would
> need methods like:
>
> 	TGPopupMenu* TGMenuBar::GetPopup(const char* title);
> 	void TGMenuBar::RemovePopup(TGPopupMenu* menu);
>
> It would also be nice to edit the menu "in place".  This would need
> methods like:
>
> 	TGMenuEntry* TGPopupMenu::GetEntry(const char* title);
> 	void TGPopupMenu::RemoveEntry(TGMenuEntry* entry);
> 	void TGPopupMenu::InsertEntryAfter(TGMenuEntry* entry,
>                                            /* rest same args as AddEntry
> */);
>
> These exact interfaces aren't necessary, but I hope you get the idea.
>
> Is there currently some way to accomplish this that I am missing?
>
> -Brett.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET