[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Changing a menu text
From:       Andras Mantia <amantia () virtualartisans ! com>
Date:       2002-09-12 18:38:10
[Download RAW message or body]

Yeah, it's a good idea. I made it in some other way (by inserting the menu 
manually at a specified position, so I know it's id), but this seems also a 
good way to go, at least for the items.

On Thursday 12 September 2002 19:22, Aaron J. Seigo wrote:
> On Thursday 12 September 2002 01:45, Andras Mantia wrote:
> > Hi,
> >
> >  How can I chane the text of the menu in the KMainWindow->menuBar()?
> > changeItem() needs the menu id, but as the menu is built up using the XML
> > GUI interface, I know olny the name (as it is specified in the XML file).
> > So, how can I find out the id of a main menu if I know only the name (the
> > displayed text is not good as it may change, also the I don't want to
> > rely on the position of the menu).
>
> try something like:
>
> actionCollection()->action("nameOfAction")->setText("New Text");
>
> this will have the benefit of changing it not only in your menu, but
> everywhere it is used, and without having to know where. (e.g. you might
> move it to another menu later, but you won't have to change the above
> code!)

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic