def addbutton(self, surface, text, click, dy): button = Button(self.prefs, self._hotkeys, text, click) button.location = 0, dy button.draw(surface) self._buttons.append(button) return dy + button.size[1]