提问人:Ariel 提问时间:10/27/2023 最后编辑:Ariel 更新时间:10/27/2023 访问量:24
Beeware Toga 选择小部件:无法更改文本大小
Beeware Toga Selection widget: unable to change text size
问:
在我的中,我正在尝试使用根据 https://toga.readthedocs.io/en/latest/reference/api/widgets/selection.html 设置参数的值。为了测试它,我使用下面附上的简单脚本。小部件工作正常,但字体大小仍然很小,无论我设置什么值。任何建议或提示如何使其工作将不胜感激Beeware app
Selection widget
font_size
is not affected
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
class HelloWorld(toga.App):
def startup(self):
self.selection=toga.Selection(style=Pack(font_size=30),\
items=["title", "message","sound"],on_select=self.func1)
main_box = toga.Box(style=Pack(direction=COLUMN))
main_box.add(self.selection)
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
def func1(self,widget):
print(self.selection.value)
return
def main():
return HelloWorld()
答: 暂无答案
评论