本文整理汇总了Python中window.Window.rmove方法的典型用法代码示例。如果您正苦于以下问题:Python Window.rmove方法的具体用法?Python Window.rmove怎么用?Python Window.rmove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window.Window
的用法示例。
在下文中一共展示了Window.rmove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import rmove [as 别名]
def main(screen):
# setup the basic syntax for text files
text_syntax = SyntaxClass("basic")
text_syntax.add("character", r".")
text_syntax.add("word", r" ")
text_syntax.add("sentance", r"\.")
# make the main window
mainwin = Window(screen, FileBuffer(open("README.markdown")))
mainwin.render()
# the event loop
while True:
event = screen.getch()
if event == ord("q"): break
if event == ord("e"): mainwin.clear()
if event == ord("r"): mainwin.render()
if event == ord("f"): mainwin.addstr("X")
if event == ord("w"): mainwin.rmove(0, -1)
if event == ord("a"): mainwin.rmove(-1, 0)
if event == ord("s"): mainwin.rmove(0, +1)
if event == ord("d"): mainwin.rmove(+1, 0)
if event == ord("x"): mainwin.here()
def find(syntaxname):
return lambda t, x, y: text_syntax.find(syntaxname, t, x, y)
if event == ord("c"): mainwin.movef(find("character"))
if event == ord("v"): mainwin.movef(find("word"))