def set_history(self, rom_name, game_name):
"""display history for rom_name"""
if not self.histview_ok:
return
rom_name = rom_name.upper()
#display
self.lsHistory = []
if rom_name not in self.history:
self.lblHeading.set_text('no history found')
self.WinMain.show_window('history')
return
tw = textwrap.TextWrapper(width=self.line_length, replace_whitespace=False)
for line in self.history[rom_name]:
if line == ' ':
wrapped_lines = ['']
else:
wrapped_lines = tw.wrap(line)
for wl in wrapped_lines:
self.lsHistory.append(wl)
self.sclHistory.ls = self.lsHistory
self.lblHeading.set_text(game_name)
self.sclHistory.set_selected(0)
self.WinMain.show_window('history')
评论列表
文章目录