self.deactivate()
-class DropDown(Parent, Button):
+class DropDown(Button):
def __init__(self, parent, rect, value, entries, callback, is_active=False):
- super().__init__(parent, rect, value, self.activate, is_active)
- self.dropdown_menu = DropDownMenu(self, rect, entries, callback)
-
- def activate(self):
- self.dropdown_menu.activate()
+ self.dropdown_menu = DropDownMenu(parent, rect, entries, callback)
+ super().__init__(parent, rect, value, self.dropdown_menu.activate, is_active)
method_name = f"handle_{pygame.event.event_name(ev.type).lower()}"
if hasattr(self, method_name):
getattr(self, method_name)(ev)
-
- def update(self):
- pass
-
- def draw(self):
- pass