Example #1
0
    def fill_board(self, board):
        if len(self.boards) == 0:
            self.boards = [board]
        if self.boards[-1] != board:
            self.boards.append(board)
        self.selected = -1
        self.buttons = []
        for i in self.removable:
            self.canvasbox.remove(i)
        self.removable = []

        elem = 0
        box = None
        for i in board['options']:
            if elem == 0:
                box = Gtk.Box()
                box.show()
                self.canvasbox.pack_start(box, True, True, SEPARATION)
                self.removable.append(box)
            option = OptionButton(i)
            option.connect('clicked', self.button_pressed)
            self.buttons.append(option)
            box.pack_start(option, True, True, SEPARATION)
            elem += 1
            if elem == MAX_PER_LINE:
                elem = 0
Example #2
0
    def fill_board(self, board):
        if len(self.boards) == 0:
            self.boards = [board]
        if self.boards[-1] != board:
            self.boards.append(board)
        self.selected = -1
        self.buttons = []
        for i in self.removable:
            self.canvasbox.remove(i)
        self.removable = []

        elem = 0
        box = None
        for i in board['options']:
            if elem == 0:
                box = Gtk.Box()
                box.show()
                self.canvasbox.pack_start(box, True, True, SEPARATION)
                self.removable.append(box)
            option = OptionButton(i)
            option.connect('clicked', self.button_pressed)
            self.buttons.append(option)
            box.pack_start(option, True, True, SEPARATION)
            elem += 1
            if elem == MAX_PER_LINE:
                elem = 0