Beeware Toga 选择小部件:无法更改文本大小

Beeware Toga Selection widget: unable to change text size

提问人:Ariel 提问时间:10/27/2023 最后编辑:Ariel 更新时间:10/27/2023 访问量:24

问:

在我的中,我正在尝试使用根据 https://toga.readthedocs.io/en/latest/reference/api/widgets/selection.html 设置参数的值。为了测试它,我使用下面附上的简单脚本。小部件工作正常,但字体大小仍然很小,无论我设置什么值。任何建议或提示如何使其工作将不胜感激Beeware appSelection widgetfont_sizeis 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()
python 文本 小部件 选择 beeware

评论

0赞 mhsmith 10/27/2023
正如我在上一个问题中提到的,开发版本有许多错误修复,所以如果你还没有尝试的话,你应该尝试一下。
0赞 mhsmith 10/27/2023
即使在开发版本上,在 Android 上更改选择字体也存在一个已知错误,因此您现在必须忍受这一点。或者,如果您在其他平台上运行,请编辑您的问题以说出是哪一个。
0赞 Ariel 10/27/2023
@mhsmith谢谢你,我一直在使用你建议的修改后的pyproject.toml,以及开发版本

答: 暂无答案