def __init__(self): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "gamelist.glade") # create gamelist window self.builder = gtk.Builder() self.builder.add_from_file(self.glade_file) self.builder.connect_signals(self) self.window = self.builder.get_object('gamelist_window') self.treeview = self.builder.get_object('gamelist_treeview') self.liststore = self.builder.get_object('liststore1') cell0 = gtk.CellRendererText() #cell0.set_property('cell-background', gtk.gdk.color_parse("#F8F8FF")) tvcolumn0 = gtk.TreeViewColumn() self.treeview.append_column(tvcolumn0) tvcolumn0.pack_start(cell0, True) tvcolumn0.set_min_width(50) tvcolumn0.set_attributes(cell0, text=0) self.tree_selection = self.treeview.get_selection() self.window.hide()
def __init__(self): self.verbose = False if self.verbose: print "set_board_colours - init" self.gui = utils.get_gui_ref() self.game = utils.get_game_ref() self.pieces = utils.get_pieces_ref() self.board = utils.get_board_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "set_colours.glade") self.pieces_glade_file = os.path.join(glade_dir, "set_pieces.glade") if Set_Board_Colours.set_board_colours_ref is not None: print "error - already have a _set_board_colours instance" Set_Board_Colours.set_board_colours_ref = self self.use_presets = True self.combo_idx = 0 self.dialog = None self.text_colour_temp = None # default colour settings self.bg_colour = '#645452' self.komadai_colour = '#c5b358' self.square_colour = '#ebdfb0' self.text_colour = '#fffdd0' self.piece_fill_colour = '#ffffd7' self.piece_outline_colour = '#000000' self.piece_kanji_colour = '#000001' self.border_colour ='#ebdfb0' self.grid_colour = '#000000'
def __init__(self): self.verbose = False if self.verbose: print "set_board_colours - init" self.gui = utils.get_gui_ref() self.game = utils.get_game_ref() self.pieces = utils.get_pieces_ref() self.board = utils.get_board_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "set_colours.glade") self.pieces_glade_file = os.path.join(glade_dir, "set_pieces.glade") if Set_Board_Colours.set_board_colours_ref is not None: print "error - already have a _set_board_colours instance" Set_Board_Colours.set_board_colours_ref = self self.use_presets = True self.combo_idx = 0 self.dialog = None self.text_colour_temp = None # default colour settings self.bg_colour = '#645452' self.komadai_colour = '#c5b358' self.square_colour = '#ebdfb0' self.text_colour = '#fffdd0' self.piece_fill_colour = '#ffffd7' self.piece_outline_colour = '#000000' self.piece_kanji_colour = '#000001' self.border_colour = '#ebdfb0' self.grid_colour = '#000000'
def __init__(self): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "engine_debug.glade") Engine_Debug.engine_debug_ref = self self.debug_text = '' self.window = None
def __init__(self): self.verbose = False self.usib, self.usiw = utils.get_usi_refs() self.gui = utils.get_gui_ref() self.board = utils.get_board_ref() self.move_list = move_list.get_ref() self.game = utils.get_game_ref() self.tc = utils.get_tc_ref() self.psn = utils.get_psn_ref() self.comments = utils.get_comments_ref()
def __init__(self): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "move_list.glade") Move_List.move_list_ref = self self.comments = utils.get_comments_ref() self.saved_move_list = [] # create move list window self.builder = gtk.Builder() self.builder.add_from_file(self.glade_file) self.builder.connect_signals(self) self.window = self.builder.get_object('move_list_window') self.treeview = self.builder.get_object('treeview1') self.liststore = self.builder.get_object('liststore1') self.scrolled_window = self.builder.get_object('move_list_scrolled_window') cell0 = gtk.CellRendererText() #cell0.set_property('cell-background', gtk.gdk.color_parse("#F8F8FF")) tvcolumn0 = gtk.TreeViewColumn('#') self.treeview.append_column(tvcolumn0) tvcolumn0.pack_start(cell0, True) tvcolumn0.set_min_width(50) tvcolumn0.set_attributes(cell0, text=0) cell1 = gtk.CellRendererText() #cell1.set_property('cell-background', gtk.gdk.color_parse("#F8F8FF")) tvcolumn1 = gtk.TreeViewColumn('Move') self.treeview.append_column(tvcolumn1) tvcolumn1.pack_start(cell1, True) tvcolumn1.set_min_width(100) tvcolumn1.set_attributes(cell1, text=1) cell2 = gtk.CellRendererText() #cell1.set_property('cell-background', gtk.gdk.color_parse("#F8F8FF")) tvcolumn2 = gtk.TreeViewColumn('Cmt') self.treeview.append_column(tvcolumn2) tvcolumn2.pack_start(cell2, True) tvcolumn2.set_min_width(20) tvcolumn2.set_attributes(cell2, text=2) self.tree_selection = self.treeview.get_selection() self.window.hide() self.update()
def __init__(self): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "engine_output.glade") Engine_Output.engine_output_ref = self self.builder = gtk.Builder() self.builder.add_from_file(self.glade_file) self.builder.connect_signals(self) self.window = self.builder.get_object('engine_output_window') self.tv = [gtk.TextView(), gtk.TextView()] self.tv[0] = self.builder.get_object('engine_output_textview1') self.tv[1] = self.builder.get_object('engine_output_textview2') self.tv[0].set_editable(False) self.tv[1].set_editable(False) tabs = pango.TabArray(4, True) tabs.set_tab(0, pango.TAB_LEFT, 40) tabs.set_tab(1, pango.TAB_LEFT, 160) tabs.set_tab(2, pango.TAB_LEFT, 230) tabs.set_tab(3, pango.TAB_LEFT, 280) self.tv[0].set_tabs(tabs) self.tv[1].set_tabs(tabs) self.tb = [gtk.TextBuffer(), gtk.TextBuffer()] self.tb[0] = self.tv[0].get_buffer() self.tb[1] = self.tv[1].get_buffer() #self.tb[0].set_text('') #self.tb[1].set_text('') self.nps_lbl = [gtk.Label(), gtk.Label()] self.nps_lbl[0] = self.builder.get_object('engine_output_nodes_lbl1') self.nps_lbl[1] = self.builder.get_object('engine_output_nodes_lbl2') self.engine_name_lbl = [gtk.Label(), gtk.Label()] self.engine_name_lbl[0] = self.builder.get_object('engine_output_engine_name_lbl1') self.engine_name_lbl[1] = self.builder.get_object('engine_output_engine_name_lbl2') self.ponder_move_lbl = [gtk.Label(), gtk.Label()] self.ponder_move_lbl[0] = self.builder.get_object('engine_output_ponder_move_lbl1') self.ponder_move_lbl[1] = self.builder.get_object('engine_output_ponder_move_lbl2') self.currmove_lbl = [gtk.Label(), gtk.Label()] self.currmove_lbl[0] = self.builder.get_object('engine_output_currmove_lbl1') self.currmove_lbl[1] = self.builder.get_object('engine_output_currmove_lbl2')
def common_settings(self, b): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "common_engine_settings.glade") self.builder = gtk.Builder() self.builder.add_from_file(self.glade_file) self.builder.connect_signals(self) dialog = self.builder.get_object('common_engine_settings') # ponder check button checkbutton = self.builder.get_object('ponderbutton') checkbutton.set_active(self.ponder) # hash value adj = self.builder.get_object('adjustment1') # These 3 lines have been replaced by the set_all command because # set_all works on older systems including ubuntu 9.04 #adj.set_lower(0) #adj.set_upper(10000) #adj.set_value(self.hash_value) # set_all # parms:value, lower, upper, step_increment, page_increment, page_size adj.set_all(self.hash_value, 0, 10000, 1, 10, 0) response = dialog.run() resp_cancel = 1 resp_ok = 2 if response == resp_ok: self.hash_value = int(adj.get_value()) self.ponder = checkbutton.get_active() dialog.destroy()
def __init__(self): self.game = utils.get_game_ref() glade_dir = self.game.get_glade_dir() self.glade_file = os.path.join(glade_dir, "comments.glade") self.move_list = move_list.get_ref() # create comments window self.builder = gtk.Builder() self.builder.add_from_file(self.glade_file) self.builder.connect_signals(self) self.window = self.builder.get_object('comments_window') self.window.hide() self.moveno = 0 # the moveno the comment applies to tv = self.builder.get_object('comments_textview') tv.set_editable(True) tv.set_wrap_mode(gtk.WRAP_WORD) self.tb = tv.get_buffer() self.tb.connect("changed", self.text_changed) self.comment_list = []
def __init__(self): self.verbose = False self.board = utils.get_board_ref() self.game = utils.get_game_ref()