PDA

View Full Version : Problem with CheckMenuItem



babyblue
1 Jul 2009, 2:45 PM
I'm having issue with CheckMenuItem's checkbox icon not updating when using 2.0-rc1, same code works with 2.0-m1. The box is checked, I can verify with a listener, but the graphics doesn't seem to get updated.



private LayoutContainer createToolbar() {
ToolBar toolbar = new ToolBar();

Menu menu = new Menu();
CheckMenuItem menuItem = new CheckMenuItem("I Like Cats");
menuItem.setChecked(true);
menu.add(menuItem);
Button item1 = new Button("Button w/ Menu");
item1.setMenu(menu);
toolbar.add(item1);

LayoutContainer parent = new LayoutContainer();
parent.add(toolbar);
return parent;
}

Lasse
15 Jul 2009, 5:31 AM
I am also experiencing this problem.
For now i am useing the hax:
item.setText(item.getText());
In response to a CheckChange event in to get the graphics to update

babyblue
15 Jul 2009, 11:21 AM
Woot, that did the trick! Thanks!