Fixed initial board update not showing
This commit is contained in:
parent
4a715d50f2
commit
b2598fb09f
1
pygo.py
1
pygo.py
|
@ -51,7 +51,6 @@ class Pygo():
|
||||||
self.gogame = gogame.GoGame(goban.Goban())
|
self.gogame = gogame.GoGame(goban.Goban())
|
||||||
self.contents.pack_start(self.gogame)
|
self.contents.pack_start(self.gogame)
|
||||||
self.gogame.show_all()
|
self.gogame.show_all()
|
||||||
self.gogame.update() # Initial board draw
|
|
||||||
|
|
||||||
|
|
||||||
def on_net_direct(self, widget):
|
def on_net_direct(self, widget):
|
||||||
|
|
|
@ -120,6 +120,8 @@ class GoGame(gtk.HBox):
|
||||||
x,y,width,height = widget.get_allocation()
|
x,y,width,height = widget.get_allocation()
|
||||||
self.board_backbuf = gtk.gdk.Pixmap(widget.window, width, height, depth=-1)
|
self.board_backbuf = gtk.gdk.Pixmap(widget.window, width, height, depth=-1)
|
||||||
self.board_backbuf.draw_rectangle(widget.get_style().white_gc, True, 0, 0, width, height)
|
self.board_backbuf.draw_rectangle(widget.get_style().white_gc, True, 0, 0, width, height)
|
||||||
|
self.update()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,11 +134,6 @@ class GoGame(gtk.HBox):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
# fixme: rendering/updating the whole board is pretty slow. Eliminate the need to
|
|
||||||
# render the whole board when a stone is played (we need a list of modified
|
|
||||||
# locations from somewhere)
|
|
||||||
# fixme: the board doesn't get drawn initially, even though the backbuffer *should*
|
|
||||||
# have the board in it before our first expose event
|
|
||||||
def update_board(self, to_update=None):
|
def update_board(self, to_update=None):
|
||||||
print 'update'
|
print 'update'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user