Is there a simple way to add a border to Kivy Labels, Buttons, Widgets etc. with-out images?

跟風遠走 提交于 2019-12-05 09:46:53

OK, I've found the fix. It was a naming conflict.

In the console log I saw that there is a problem at unpacking the border tuple in BorderImage of the button. Of course, that's not working because my border is implemented differently. Maybe I can add the list (top, right, bottom, left) to my border implementation so I can keep the same name. But I haven't checked that yet.

Changing the naming of my border to borders in python and in kv fixed the problem:

class BorderBehavior(Widget):
    borders = ObjectProperty(None)

Now it looks like I want it:

OK, now I'll check if it's working for other classes too (e.g. Scatter, Widget,...). If that's working I'm doing a pull request to Kivy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!