[gnome-games/sudoku-tube] Extract method, trivial
- From: Zhang Sen <zhangsen src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games/sudoku-tube] Extract method, trivial
- Date: Wed, 8 Jul 2009 14:57:46 +0000 (UTC)
commit ea2982e49984f82e7838b0bb931a5a0a88a1e4c8
Author: Zhang Sen <zh jesse gmail com>
Date: Wed Jul 8 22:18:26 2009 +0800
Extract method, trivial
gnome-sudoku/src/lib/gsudoku.py | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/gsudoku.py b/gnome-sudoku/src/lib/gsudoku.py
index d2848a5..3201c49 100644
--- a/gnome-sudoku/src/lib/gsudoku.py
+++ b/gnome-sudoku/src/lib/gsudoku.py
@@ -39,6 +39,17 @@ class SudokuNumberGrid (gtk.AspectFrame):
self.table = gtk.Table(rows = group_size, columns = group_size, homogeneous = True)
self.group_size = group_size
self.__entries__ = {}
+ self._setup_table()
+
+ gtk.AspectFrame.__init__(self, obey_child = False)
+ self.set_shadow_type(gtk.SHADOW_NONE)
+ self.eb = gtk.EventBox()
+ self.eb.add(self.table)
+ self.add(self.eb)
+ self.connect('size-allocate', self._allocate_cb)
+ self.show_all()
+
+ def _setup_table(self):
for x in range(self.group_size):
for y in range(self.group_size):
e = number_box.SudokuNumberBox(upper = self.group_size)
@@ -47,13 +58,6 @@ class SudokuNumberGrid (gtk.AspectFrame):
self.table.attach(e, x, x+1, y, y+1,
)
self.__entries__[(x, y)] = e
- gtk.AspectFrame.__init__(self, obey_child = False)
- self.set_shadow_type(gtk.SHADOW_NONE)
- self.eb = gtk.EventBox()
- self.eb.add(self.table)
- self.add(self.eb)
- self.connect('size-allocate', self._allocate_cb)
- self.show_all()
def _allocate_cb (self, widget, rect):
if rect.width > rect.height:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]