def show(self, render_fn=None): """Show the widget.""" # Call render() method if exists if hasattr(self, "render"): self.render() if hasattr(self, "panel"): uni.show_panel(self.panel) uni.update_panels()
def display(self): #self.panel.top() uni.top_panel(self.panel) uni.show_panel(self.panel) #self.panel.show() uni.clear() #self.window.clear() while True: uni.refresh() #self.window.refresh() uni.doupdate() for index, item in enumerate(self.items): if index == self.position: mode = uni.A_REVERSE else: mode = uni.A_NORMAL msg = '%d. %s' % (index, item[0]) uni.mvaddstr(1 + index, 1, msg, mode) key = uni.getch() if key in [uni.KEY_ENTER, ord('\n')]: if self.position == len(self.items) - 1: break else: self.items[self.position][1]() elif key == uni.KEY_UP: self.navigate(-1) elif key == uni.KEY_DOWN: self.navigate(1) uni.clear() #self.window.clear() uni.hide_panel(self.panel) #self.panel.hide() uni.update_panels() #panel.update_panels() uni.doupdate()
def enable(self): if not self.enabled: self.locked_buttons = copy.copy(self.to_stay_lock) self.to_stay_lock = [] show_panel(self.game_menu_interface_panel) self.enabled = True
def enable(self): if not self.enabled: self.enabled = True show_panel(self.game_field_panel)
def enable(self): if not self.enabled: self.enabled = True show_panel(self.game_stat_panel)
def enable(self): if not self.enabled: self.locked_topics = copy.copy(self.to_stay_lock) self.to_stay_lock = [] show_panel(self.panel) self.enabled = True