Page 1 of 1

a checkbok in a popupmenu from a menubar

Posted: Wed Dec 21, 2005 16:13
by pabloa
How do it?

following my intuation I wrote this code, but didnt worked:

Code: Select all

CEGUI::MenuItem* itemv4=(CEGUI::MenuItem*)CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/PopupMenuItem", (CEGUI::utf8*)"v4");
   itemv4->setText("Left");

   popupmview->addChildWindow(itemv4);
   
CEGUI::Checkbox* ckb1=(CEGUI::Checkbox*)CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/Checkbox", (CEGUI::utf8*)"ckb4");
   
   itemv4->addChildWindow(ckb1);


I tried too use only the checkbok neither worked

Re: a checkbok in a popupmenu from a menubar

Posted: Thu Dec 22, 2005 12:00
by martignasse
hi pablloa,

the problem is that the MenuItem isn't herited from Window widget (until the 0.5 version).

You have to make you'r own MenuItem who can deal with a checkbox.

Re: a checkbok in a popupmenu from a menubar

Posted: Thu Dec 22, 2005 14:23
by martignasse
forget my last post... :oops: was hard flying...

For the code you provide, you didn't put position and dimension for you'r checkbox, which is bad.

i suggest you to make you'r own MenuItem class with all the management for the checkbox.


hope it help.