Make go board widget show (even if it doesn't quite work yet)

This commit is contained in:
2012-04-17 01:21:39 -04:00
parent 966c6eb9e7
commit 38b298ec45
2 changed files with 23 additions and 8 deletions

18
pygo.py
View File

@ -5,10 +5,12 @@
import sys
sys.path.append('lib/')
sys.path.append('widgets/')
import goban
import config
import gtk, gtk.glade, gobject
import gogame
class Pygo():
@ -22,7 +24,8 @@ class Pygo():
self.our_color = None
self.init_user_interface('./ui/default.glade')
self.init_widgets()
self._init_widgets()
def init_user_interface(self, path_to_skin):
self.tree=gtk.glade.XML(path_to_skin, "window")
@ -31,20 +34,27 @@ class Pygo():
self.contents = self.tree.get_widget('main_box')
def init_widgets(self):
def _init_widgets(self):
self.window.resize(1000,800)
self.gogame = None
# gobject.timeout_add(1000, self.update)
def on_local_new(self, widget):
if self.gogame:
self.contents.remove(self.gogame)
del self.gogame
if self.goban:
del self.goban
self.goban = goban.Goban()
self.network_mode = False
self.our_color = None
# fixme: create the go board widget and add it to our box here
self.gogame = gogame.GoGame(self.goban)
self.contents.pack_start(self.gogame)
self.gogame.show_all()