|
|
|
@ -9,34 +9,26 @@ class TileSelector(Gtk.Window):
@@ -9,34 +9,26 @@ class TileSelector(Gtk.Window):
|
|
|
|
|
Gtk.Window.__init__(self) |
|
|
|
|
self.connect("destroy", Gtk.main_quit) |
|
|
|
|
|
|
|
|
|
grid = Gtk.Grid() |
|
|
|
|
self.grid = Gtk.Grid() |
|
|
|
|
|
|
|
|
|
straight_h = StraigthH() |
|
|
|
|
straight_h.connect('button-press-event',self.select) |
|
|
|
|
self.add_tile(StraightH,0,0) |
|
|
|
|
self.add_tile(StraightV,1,0) |
|
|
|
|
self.add_tile(Diag_TL,0,1) |
|
|
|
|
self.add_tile(Diag_TR,1,1) |
|
|
|
|
self.add_tile(Diag_BR,2,1) |
|
|
|
|
self.add_tile(Diag_BL,3,1) |
|
|
|
|
self.add_tile(TO_BRL,0,2) |
|
|
|
|
|
|
|
|
|
straight_v = StraigthV() |
|
|
|
|
straight_v.connect('button-press-event',self.select) |
|
|
|
|
|
|
|
|
|
diag_tl = Diag_TL() |
|
|
|
|
diag_tl.connect('button-press-event',self.select) |
|
|
|
|
|
|
|
|
|
diag_br = Diag_BR() |
|
|
|
|
diag_br.connect('button-press-event',self.select) |
|
|
|
|
|
|
|
|
|
to_brl = TO_BRL() |
|
|
|
|
to_brl.connect('button-press-event',self.select) |
|
|
|
|
|
|
|
|
|
grid.attach(straight_h,0,0,1,1) |
|
|
|
|
grid.attach(straight_v,1,0,1,1) |
|
|
|
|
grid.attach(diag_tl,0,1,1,1) |
|
|
|
|
grid.attach(diag_br,1,1,1,1) |
|
|
|
|
grid.attach(to_brl,1,2,1,1) |
|
|
|
|
|
|
|
|
|
self.add(grid) |
|
|
|
|
self.add(self.grid) |
|
|
|
|
|
|
|
|
|
self.show_all() |
|
|
|
|
Gtk.main() |
|
|
|
|
|
|
|
|
|
def add_tile(self,tile_class,x,y): |
|
|
|
|
tile = tile_class() |
|
|
|
|
tile.connect('button-press-event',self.select) |
|
|
|
|
self.grid.attach(tile,x,y,1,1) |
|
|
|
|
|
|
|
|
|
def select(self,btn,evt): |
|
|
|
|
self.tile = btn.__class__ |
|
|
|
|
self.hide() |
|
|
|
|