Ejemplo n.º 1
0
    def on_button(self, button_id):
        # get the clicked button.
        try:
            level = self.levels[button_id]
        except KeyError:
            return

        # remove any other description box.
        self.kill_desc()

        # get a unique name to register to close the description box.
        unique = Unique()
        close_name = unique.generate(level.name)
        self.active_desc = close_name

        # should now create a co-menu with the description.
        child = self.parent.add_child(DescriptionBox, text=level.description,
                closename=close_name)
        child.resume()