【发布时间】:2021-03-03 22:35:20
【问题描述】:
我们以calculator.py 为例。
要添加与鼠标滚轮配合使用的滚动条,您需要更改:
output_field = TextArea(style="class:output-field", text=help_text)
到:
output_field = TextArea(style="class:output-field", text=help_text, scrollbar=True)
但是您会添加或更改什么来使用向上翻页和向下翻页键滚动 TextArea?
# The key bindings.
kb = KeyBindings()
@kb.add("pageup")
def _(event):
# What goes here?
pass
@kb.add("pagedown")
def _(event):
# What goes here?
pass
【问题讨论】:
标签: python textarea prompt-toolkit