本文整理汇总了Python中urwid.escape.set_cursor_position函数的典型用法代码示例。如果您正苦于以下问题:Python set_cursor_position函数的具体用法?Python set_cursor_position怎么用?Python set_cursor_position使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_cursor_position函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _stop
def _stop(self):
"""
Restore the screen.
"""
self.clear()
signals.emit_signal(self, INPUT_DESCRIPTORS_CHANGED)
self.signal_restore()
fd = self._term_input_file.fileno()
if os.isatty(fd):
termios.tcsetattr(fd, termios.TCSADRAIN,
self._old_termios_settings)
self._mouse_tracking(False)
move_cursor = ""
if self._alternate_buffer:
move_cursor = escape.RESTORE_NORMAL_BUFFER
elif self.maxrow is not None:
move_cursor = escape.set_cursor_position(
0, self.maxrow)
self.write(
self._attrspec_to_escape(AttrSpec('',''))
+ escape.SI
+ move_cursor
+ escape.SHOW_CURSOR)
if self._old_signal_keys:
self.tty_signal_keys(*(self._old_signal_keys + (fd,)))
super(Screen, self)._stop()
示例2: stop
def stop(self):
"""
Restore the screen.
"""
self.clear()
if not self._started:
return
self.signal_restore()
termios.tcsetattr(0, termios.TCSADRAIN,
self._old_termios_settings)
move_cursor = ""
if self.gpm_mev:
self._stop_gpm_tracking()
if self._alternate_buffer:
move_cursor = escape.RESTORE_NORMAL_BUFFER
elif self.maxrow is not None:
move_cursor = escape.set_cursor_position(
0, self.maxrow)
self._term_output_file.write(self._attrspec_to_escape(AttrSpec('',''))
+ escape.SI
+ escape.MOUSE_TRACKING_OFF
+ escape.SHOW_CURSOR
+ move_cursor + "\n" + escape.SHOW_CURSOR )
self._input_iter = self._fake_input_iter()
if self._old_signal_keys:
self.tty_signal_keys(*self._old_signal_keys)
super(Screen, self).stop()
示例3: do_stop
def do_stop(self):
self.clear()
self.signal_restore()
fd = self._term_input_file.fileno()
if os.isatty(fd):
termios.tcsetattr(fd, termios.TCSADRAIN, self._old_termios_settings)
move_cursor = ""
if self.gpm_mev:
self._stop_gmp_tracking()
if self.use_alternate_buffer:
move_cursor = escape.RESTORE_NORMAL_BUFFER
elif self.maxrow is not None:
move_cursor = escape.set_cursor_position(0, self.maxrow)
self._term_output_file.write(self._attrspec_to_escape(AttrSpec('', ''))
+ escape.SI
+ escape.MOUSE_TRACKING_OFF
+ escape.SHOW_CURSOR
+ move_cursor + "\n"
+ escape.SHOW_CURSOR
)
self._input_iter = self._fake_input_iter()
if self._old_signal_keys:
self.tty_signal_keys(*(self._old_signal_keys + (fd,)))
self._started = False
示例4: set_cursor_position
def set_cursor_position(x, y):
if not partial_display():
return escape.set_cursor_position(x, y)
if cy > y:
return ('\b' + escape.CURSOR_HOME_COL +
escape.move_cursor_up(cy - y) +
escape.move_cursor_right(x))
return ('\b' + escape.CURSOR_HOME_COL +
escape.move_cursor_down(y - cy) +
escape.move_cursor_right(x))
示例5: set_cursor_row
def set_cursor_row(y):
if not partial_display():
return escape.set_cursor_position(0, y)
return escape.move_cursor_down(y - cy)
示例6: set_cursor_home
def set_cursor_home():
if not partial_display():
return escape.set_cursor_position(0, 0)
return (escape.CURSOR_HOME_COL +
escape.move_cursor_up(cy))