[gnome-games/sudoku-tube] Add the side-grid to display the peer's puzzle
- From: Zhang Sen <zhangsen src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games/sudoku-tube] Add the side-grid to display the peer's puzzle
- Date: Sat, 4 Jul 2009 14:20:12 +0000 (UTC)
commit 5ebfa937c928dff5093b05476ebc13dc485cee32
Author: Zhang Sen <zh jesse gmail com>
Date: Sat Jul 4 22:18:16 2009 +0800
Add the side-grid to display the peer's puzzle
Use Glade to pack the UI
gnome-sudoku/data/main.ui | 47 +++++++++++++++++++++++++++++++++++++----
gnome-sudoku/src/lib/main.py | 14 +++++++++---
2 files changed, 52 insertions(+), 9 deletions(-)
---
diff --git a/gnome-sudoku/data/main.ui b/gnome-sudoku/data/main.ui
index 3c073cb..de43d31 100644
--- a/gnome-sudoku/data/main.ui
+++ b/gnome-sudoku/data/main.ui
@@ -419,13 +419,50 @@
<object class="GtkHBox" id="main_area">
<property name="visible">True</property>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
+ <object class="GtkHBox" id="main_grid_container">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkVBox" id="side_bar">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkVBox" id="tracker_ui_container">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="side_grid_container">
+ <property name="visible">True</property>
+ <property name="yalign">1</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index 68a989d..2e7f4c5 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -183,16 +183,21 @@ class UI (gconf_wrapper.GConfWrapper):
self.toolbar = self.builder.get_object("toolbar")
def _setup_main_boxes(self):
- main_area = self.builder.get_object("main_area")
+ main_grid_container = self.builder.get_object("main_grid_container")
+ side_grid_container = self.builder.get_object("side_grid_container")
+ tracker_ui_container = self.builder.get_object("tracker_ui_container")
self.gsd = gsudoku.SudokuGameDisplay()
self.gsd.connect('puzzle-finished', self.you_win_callback)
- main_area.pack_start(self.gsd, padding = 6)
+ main_grid_container.pack_start(self.gsd, padding = 6)
self.tracker_ui = tracker_box.TrackerBox(self)
- self.tracker_ui.show_all()
self.tracker_ui.hide()
- main_area.pack_start(self.tracker_ui, expand=False)
+ tracker_ui_container.pack_start(self.tracker_ui)
+
+ self._side_gsd = gsudoku.SudokuGameDisplay()
+ self._side_gsd.hide()
+ side_grid_container.add(self._side_gsd)
def setup_color (self):
# setup background colors
@@ -355,6 +360,7 @@ class UI (gconf_wrapper.GConfWrapper):
"""Called when the peer accepts our tube"""
server = networking.GameServer(bus, obj_path, self)
logger.info("server created")
+ self._side_gsd.show()
def _close_current_game (self):
"""Close current running game
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]