Discussion Board
Series60 SDK : ChangeMenuBarL
2002-06-01, 21:13
#1
Super Contributor
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
2002-06-01, 21:14
#2
Super Contributor
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
2002-12-04, 07:04
#3
Registered User
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)
Registered User
CONE 44 means that: Control being destroyed is still on the control stack
you must remove menu bar from control stack before exit
Re: Series60 SDK : ChangeMenuBarL
2006-08-02, 01:40
#5
Registered User
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.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules