SandmanChess.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:SandmanChess 作者: ThomasMadappattu 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号