【发布时间】:2018-07-02 02:33:18
【问题描述】:
我想要 kivy reStructuredText 渲染器中引用的弹出效果,默认情况下,当我们按下任何引用时,它会滚动到引用,这里我想用弹出替换滚动,我已经搜索了很长时间但徒劳无功,今天我在 kivy 文档中找到了goto(ref, *largs),是否可以使用它来调用参考弹出窗口?是否可以在另一个类中重新定义 RstDocument 函数并使用它?我是初学者。
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_string("""
<RSTGUI>:
RstDocument:
text: root.doc
goto: # Any Popup aur bubble with reference
""")
class RSTGUI(BoxLayout):
doc="""
.. _top:
Hello world
===========
This is an **emphased text**, some ``interpreted text``.
And this is a reference to top_::
$ print("Hello world")
"""
class RST(App):
def build(self):
return RSTGUI()
if __name__=='__main__':
RST().run()
【问题讨论】:
标签: python popup kivy restructuredtext