def option_popup(self, x, y): """ Show popup menu for option button. """ _ = self.res.get popup = PopupMenuWrapper(self.ctx, ( MenuEntry(_("Clear"), 32, 0, "clear"), MenuEntry("", -1, 1, ""), MenuEntry(_("Input line"), 1024, 2, "switch_inputline", style=MIS_CHECKABLE), MenuEntry(_("Store watches"), 2048, 3, "switch_store", style=MIS_CHECKABLE), MenuEntry("", -1, 4, ""), MenuEntry(_("Settings..."), 512, 5, "settings"), MenuEntry(_("About"), 4096, 6, "about"), ), True) popup.checkItem(1024, self.input_line_shown) popup.checkItem(2048, self.model.store_watches) n = popup.execute(self.cont.getPeer(), x, y) if n > 0: self.execute_cmd(popup.getCommand(n))