diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 153fdc16e..ae90ba51f 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -384,20 +384,18 @@ public abstract class Editor extends JFrame implements RunnerListener { protected void initModeMenu() { modeMenu = new JMenu(); + ButtonGroup modeGroup = new ButtonGroup(); for (final Mode m : base.getModeList()) { + JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle()); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + base.changeMode(m); + } + }); + modeMenu.add(item); + modeGroup.add(item); if (mode == m) { - JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle()); - // doesn't need a listener, since it doesn't do anything item.setSelected(true); - modeMenu.add(item); - } else { - JMenuItem item = new JMenuItem(m.getTitle()); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - base.changeMode(m); - } - }); - modeMenu.add(item); } } diff --git a/todo.txt b/todo.txt index 56d24fba5..04786c30c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,7 @@ 0228 pde X increase heap size to 256m (-Xmx256) per Manindra request +X use a ButtonGroup so that the current Mode cannot be de-selected +X https://github.com/processing/processing/issues/2545 _ color selector for the pref _ https://github.com/processing/processing/pull/2568