In the kivy doc there is the function add_widget(widget, index=0, canvas=None)
and we must be able to set an index to position the widget.
index: int, defaults to 0
Index to insert the widget in the list. Notice that the default of 0 means the widget is inserted at the beginning of the list and will thus appear under the other widgets. For a full discussion on the index and widget hierarchy, please see the Widgets Programming Guide.
So first either index I try nothing change on the widget order. And then i would like to insert my widget at the end of the list and not at the beginning.
If you have some idea :)
Widgets in Kivy are organized in trees. Your application has a root widget , which usually has children that can have children of their own. Children of a widget are represented as the children attribute, a Kivy ListProperty .
pos : pos stands for position i.e it is used to position the widget. By default (0, 0), the bottom-left corner of the screen is the default position of the button in kivy python.
I found the solution:
self.add_widget(your_widget, len(self.children))
If you print self.children you will see the object added at the end of the list and it will reverse the display order on the view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With