Series60 SDK : ChangeMenuBarL
Calling
aMenuBar->ChangeMenuBarL(0, R_AKNEXLIST_MENUBAR_OTHER,ETrue);
from within
DynInitMenuBarL( TInt aResourceId,CEikMenuBar* aMenuBar)
does not work.
I saw the same problem raised in January, does anybody know how to make it work ?
Thanks
Posted by Etienne Richelle, clevering@club-internet.fr
on March 13, 2002 at 20:36
RE: Series60 SDK : ChangeMenuBarL
Posted by Robert Kacirek, robert.kacirek@uniweb.cz
on March 18, 2002 at 13:37
Hi, I had the same problems as you. I did not find a solution with ChangeMenuBarL, but you can try instead DynIniMenuBarL use DynInitMenuPaneL. This works litle bit strange, but works.
My opinion is, that on Series60 is not standard menu bar, only a pane.
Good luck.
RE: Series60 SDK : ChangeMenuBarL
Me too having the same problem.
I was trying to work around with this and found the following piece of code work:
--- CODE START ---
CEikMenuBar* iMenuBar; // .h file
iMenuBar=new(ELeave) CEikMenuBar();
iMenuBar->ConstructL(this,0,R_YOURAPP_MENUBAR_VIEW2); // this=AppUi
AddToStackL(iMenuBar);
CEikonEnv::Static()->AppUiFactory()->SwapMenuBar(iMenuBar);
--- END ---
(If you want to switch back, use back the same code but pass in a different menubar resource ID)
However, on exit it panicked with CONE 44. Do you know the meaning of it?
Could you please post back here (or e-mail me) if you fix it?
Khan Ming (ming@alchemy.com.my)
Re: Series60 SDK : ChangeMenuBarL
Actually the right solution to avoid CONE 44 would be:
--- CODE START ---
CEikMenuBar* iMenuBar; // .h file
iMenuBar=new(ELeave) CEikMenuBar();
iMenuBar->ConstructL(this,0,R_YOURAPP_MENUBAR_VIEW2); // this=AppUi
AddToStackL(iMenuBar);
CEikMenuBar *tempbar = CEikonEnv::Static()->AppUiFactory()->SwapMenuBar(iMenuBar);
RemoveFromStackL(tempbar);
delete tempbar;
--- END ---
- the reason is, if you replace a menu bar, you have to dispose of the old one yourself.