globalforest/treepopupmenu.py
2020-10-14 07:19:43 +03:00

14 lines
466 B
Python

from kivymd.uix.dialog2 import ListMDDialog
class TreePopupMenu(ListMDDialog):
def __init__(self, tree_data):
super().__init__()
# Set all of the fields of tree data
headers = "Name,Lat,Lon,Description"
headers = headers.split(',')
for i in range(len(headers)):
attribute_name = headers[i]
attribute_value = tree_data[i]
setattr(self, attribute_name, attribute_value)