def switch_states(self, state):
# this method is run to switch states, it reassigns what content is in the Frame
if state == 'editor':
self.top.contents['header'] = (self.status, None)
self.top.contents['body'] = (self.body_col, None)
self.top.contents['footer'] = (self.foot_col, None)
if self.layout:
self.top.contents['footer'] = (self.status, None)
self.top.contents['header'] = (self.foot_col, None)
elif state == 'openfile':
path = strip_path(self.listbox.fname)
self.browser = urwid.TreeListBox(urwid.TreeWalker(DirectoryNode(path, self)))
self.top.contents['header'] = (self.oftbar, None)
self.top.contents['body'] = (self.browser, None)
self.top.contents['footer'] = (self.ofbbar, None)
self.ofbbar.set_text('')
self.state = state
评论列表
文章目录