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

List:       kde-devel
Subject:    Re: adding a menu to a KMainApplication
From:       Lorenzo Bettini <bettini () dsi ! unifi ! it>
Date:       2007-12-12 19:06:41
Message-ID: 47603141.2080609 () dsi ! unifi ! it
[Download RAW message or body]

Andras Mantia wrote:
> On Tuesday 27 November 2007, Lorenzo Bettini wrote:
> > Sorry if I insist on this: isn't there a way to add a menu from the
> > application itself with insertItem()?
> 
> Yes, it is possible.
> Use something like:
> 
> KMenuBar *mb = yourApp->menuBar();
> mb->activateItemAt(-1); //needed as insertItem might crash if a menu is 
> activated
> mb->insertItem(i18n("YourMenu"), aQPopupMenu, -1, 5 /*the place to 
> insert to*/);
> 
> 
> yourApp is a pointer to KMainWindow or KMdiMainFrm.
> 
> This works, the proof is at 
> http://websvn.kde.org/branches/KDE/3.5/kdewebdev/quanta/components/debugger/debuggerui.cpp?revision=455191&view=markup
>  
> DebuggerUI::showMenu() method.
> 

thanks!
I'll try to apply this code

cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
 
> > 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