def ok_pressed(self):
self.currentSelection = self.GameListBox.curselection()
if ( len(self.filtered_list) <= 0 ):
self.filtered_list = self.pgn_item_list
if ( len(self.filtered_list) <= 0):
return
print(self.currentSelection)
if ( len(self.currentSelection) <= 0 ):
tkMessageBox.showinfo(" Please","select a game ")
return
else:
self.currentSelection = int( self.currentSelection[0] )
self.parentUI.pgn_file.seek(self.filtered_list[self.currentSelection].offset)
self.parentUI.pgnGame = chess.pgn.read_game(self.parentUI.pgn_file)
self.parentUI.currentGameNode = self.parentUI.pgnGame
self.parentUI.chessBoard = self.parentUI.pgnGame.board()
self.current_pgn_index = 0
self.parentUI.draw_main_board()
self.parentUI.txtPgn.config(state=NORMAL)
self.parentUI.txtPgn.delete(1.0,END)
self.parentUI.txtPgn.insert(END,str(self.parentUI.pgnGame))
self.parentUI.txtPgn.config(state=DISABLED)
self.parentUI.set_info(self.filtered_list[self.currentSelection].header)
self.pgnFrame.destroy()
评论列表
文章目录