コード例 #1
0
 def increase_score(self):
     if len(self.scores) == 0:
         # Cache the score icon
         score_label = Score(self.fill_color, self.stroke_color)
         score_pixbuf_unsel = score_label.get_pixbuf()
         score_pixbuf_sel = score_label.get_pixbuf_sel()
     else:
         score_pixbuf_unsel = None
         score_pixbuf_sel = None
     
     new_score = Score(self.fill_color, self.stroke_color,
                       score_pixbuf_sel, score_pixbuf_unsel, self.status)
     self.scores.append(new_score)
     new_score.show()
     self.score_table.attach(new_score, self.current_x , self.current_x + 1,
             self.current_y, self.current_y + 1, gtk.SHRINK, gtk.SHRINK)
     self.current_x += 1
     if self.current_x == self._score_cols:
         self.current_x = 0
         self.current_y += 1
     self.queue_draw()