【发布时间】:2018-09-08 10:02:42
【问题描述】:
我正在使用 Python 2.7 和 kivy。我运行test.py,直接从文件夹替换test.png 后,click on press me 然后新图像不显示。谁能告诉我如何刷新图像?
test.py
from kivy.app import App
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.lang import Builder
Builder.load_string('''
#:kivy 1.10.0
<abc>:
background: 'test.png'
''')
class abc(Popup):
pass
class PopupApp(App):
title = 'Popup Demo'
def build(self):
self._popup = abc()
return Button(text="press me", on_press=self._popup.open)
PopupApp().run()
【问题讨论】:
标签: python python-2.7 kivy