Exemplo n.º 1
0
 def _init_stripes(self):
     layout = Clutter.GridLayout()
     layout.set_row_spacing(dims.H_SPACING_PX)
     self.set_layout_manager(layout)
     for i in range(STRIPE_COUNT):
         actor = Stripe()
         layout.attach(actor, 1, i, 1, 1)
Exemplo n.º 2
0
    def __init__(self, contents):
        super(TilesTable, self).__init__()
        letters = [
            'a', 'i', 'e', 'r', 'c', 'p', 'l', 'ę', 'o', 'z', 'w', 'y', 'm',
            'ł', 'h', 'ż', 'n', 's', 'k', 'u', 'b', 'ą', 'ś', 'f', 't', 'd',
            'j', 'g', 'ó', 'ć', 'ń', 'ź'
        ]
        actions = ['reset', 'zamknij']
        self.contents = contents
        self.tiles = []
        layout = Clutter.GridLayout()
        self.set_layout_manager(layout)
        layout.set_row_spacing(10)
        layout.set_column_spacing(10)
        layout.set_column_homogeneous(True)
        layout.set_row_homogeneous(True)
        self.row_count = 5
        self.col_count = 6
        for i in range(self.row_count):
            for j in range(self.col_count):
                if i == self.row_count - 1:
                    if j % 3 == 0:
                        tile = ActionTile()
                        tile.set_icon_from_file('./' + actions[j % 2] + '.png')
                        tile.set_label(actions[j % 2])
                        layout.attach(tile, j, i, 3, 1)
                else:
                    tile = ActionTile()
                    tile.set_icon_from_file('./empty.png')
                    tile.set_label(str(i) + ' ' + str(j))
                    layout.attach(tile, j, i, 1, 1)

                self.tiles.append(tile)

        self.update_tiles(range(len(self.tiles)), 'off')
Exemplo n.º 3
0
 def __init__(self, container):
     super(FirstPracticePanel, self).__init__()
     self.container = container
     self.word = container.word
     self.layout = Clutter.GridLayout()
     self.set_layout_manager(self.layout)
     self.layout.set_row_homogeneous(True)
     self.layout.set_column_homogeneous(True)
     self.set_y_expand(True)
     self.set_x_expand(True)
     self.layout.set_column_spacing(10)
     self.layout.set_row_spacing(10)
     self._init_params()
     self._init_elements()
Exemplo n.º 4
0
 def __init__(self, container):
     super(MainPanel, self).__init__()
     self.container = container
     self.word = container.word
     self.result = container.result
     self.word_index = container.word_index
     self.words_list = container.words_list
     self.points_limit = container.points_limit
     self.layout = Clutter.GridLayout()
     self.set_layout_manager(self.layout)
     self.layout.set_row_homogeneous(True)
     self.layout.set_column_homogeneous(True)
     self.layout.set_column_spacing(10)
     self.layout.set_row_spacing(10)
     self.set_y_expand(True)
     self.set_x_expand(True)
     self._init_params()
     self._init_elements()
Exemplo n.º 5
0
 def __init__(self, container):
     super(PracticePanel, self).__init__()
     self.container = container
     self.word = container.word
     self.layout = Clutter.GridLayout()
     self.set_layout_manager(self.layout)
     self.layout.set_row_homogeneous(True)
     self.layout.set_column_homogeneous(True)
     self.set_y_expand(True)
     self.set_x_expand(True)
     self.layout.set_column_spacing(10)
     self.layout.set_row_spacing(10)
     self.set_reactive(True)
     self.connect('button_release_event',
                  lambda x, y: self.on_click_event())
     self._init_params()
     self._init_elements()
     self._init_timer()
Exemplo n.º 6
0
 def __init__(self, contents):
     super(TilesTable, self).__init__()
     letters = [
         'a', 'i', 'e', 'r', 'c', 'p', 'l', 'ę', 'o', 'z', 'w', 'y', 'm',
         'ł', 'h', 'ż', 'n', 's', 'k', 'u', 'b', 'ą', 'ś', 'f', 't', 'd',
         'j', 'g', 'ó', 'ć', 'ń', 'ź'
     ]
     actions = [
         'spacja', 'skasuj', 'wczytaj', 'zapisz', 'przywróć', 'wyczyść',
         'zmień typ', 'zamknij'
     ]
     self.contents = contents
     self.text_field = contents.text_field
     self.text_buffer = contents.text_field.text_buffer
     self.tiles = []
     layout = Clutter.GridLayout()
     self.set_layout_manager(layout)
     layout.set_row_spacing(20)
     layout.set_column_spacing(20)
     layout.set_column_homogeneous(True)
     layout.set_row_homogeneous(True)
     self.row_count = 5
     self.col_count = 8
     for i in range(self.row_count):
         for j in range(self.col_count):
             if i == self.row_count - 1:
                 tile = ActionTile()
                 tile.set_icon_from_file('./icon.png')
                 tile.set_label(actions[i * self.col_count + j -
                                        len(letters)])
             else:
                 tile = LetterTile()
                 tile.set_letter_label(letters[i * self.col_count + j])
             self.tiles.append(tile)
             layout.attach(tile, j, i, 1, 1)
     self.update_tiles(range(len(self.tiles)), 'off')
Exemplo n.º 7
0
 def _init_layout(self):
     self.layout = Clutter.GridLayout()
     self.set_layout_manager(self.layout)