Example #1
0
    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()
Example #2
0
 def disable(self):
     if self.enabled:
         self.enabled = False
         hide_panel(self.game_field_panel)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 def disable(self):
     if self.enabled:
         self.enabled = False
         hide_panel(self.game_field_panel)
Example #7
0
 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)
Example #8
0
 def hide(self):
     """Hide the widget."""
     uni.hide_panel(self.panel)
     uni.update_panels()