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 disable(self): if self.enabled: self.enabled = False hide_panel(self.game_field_panel)
def disable(self): if self.enabled: self.to_stay_lock = copy.copy(self.locked_buttons) self.locked_buttons = list(range(0, len(self.buttons))) self.enabled = False hide_panel(self.game_menu_interface_panel)
def disable(self): if self.enabled: self.to_stay_lock = copy.copy(self.locked_topics) self.locked_topics = list(range(0, len(self.topics))) self.enabled = False hide_panel(self.panel)
def hide(self): """Hide the widget.""" uni.hide_panel(self.panel) uni.update_panels()