globalforest/treepopupmenu.py

14 lines
466 B
Python
Raw Normal View History

2020-10-14 00:19:43 -04:00
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)